Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Fix Tuple Type Hint Validation #477

Open
christophercrouzet opened this issue Jan 30, 2025 · 0 comments
Open

[BUG] Fix Tuple Type Hint Validation #477

christophercrouzet opened this issue Jan 30, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@christophercrouzet
Copy link
Member

Bug Description

Warp currently supports defining tuple type hints with int elements but not with other types, so the following will fail:

from typing import Tuple

import warp as wp

@wp.func
def foo() -> Tuple[wp.vec3f, float]:
    return (wp.vec3(), 1.23)

@wp.kernel
def kernel():
    vec, val = foo()

wp.launch(kernel, dim=1)

The current workaround is to remove the type hint altogether and let Warp infers it from the code, e.g. this works:

import warp as wp

@wp.func
def foo():
    return (wp.vec3(), 1.23)

@wp.kernel
def kernel():
    vec, val = foo()

wp.launch(kernel, dim=1)

System Information

No response

@christophercrouzet christophercrouzet added the bug Something isn't working label Jan 30, 2025
@christophercrouzet christophercrouzet self-assigned this Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant