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

Update convert_inputs_to_tensors to require Python numbers #168

Open
pranavm-nvidia opened this issue Aug 30, 2024 · 0 comments
Open

Update convert_inputs_to_tensors to require Python numbers #168

pranavm-nvidia opened this issue Aug 30, 2024 · 0 comments
Labels
tripy Pull request for the tripy project

Comments

@pranavm-nvidia
Copy link
Collaborator

convert_inputs_to_tensors currently passes any non-tensor arguments directly to the Tensor constructor, which means that it ends up enabling more than just Python numbers (which was its original intention) in our APIs. The issue is that this makes the API inconsistent, with some APIs working fine with DLPack tensors and others not.

We should update convert_inputs_to_tensors to only accept Python numbers to avoid this.

This change will also make it slightly easier to fix #154 since we can just look at the Python type to determine whether or not to allow automatic type conversions.

@pranavm-nvidia pranavm-nvidia added the tripy Pull request for the tripy project label Aug 30, 2024
slyubomirsky added a commit that referenced this issue Sep 16, 2024
…inputs_to_tensors` decorator (#185)

Addresses issue #168 and does not permit implicit conversion of non-Tripy inputs other than Python numbers (e.g., Numpy arrays). Expands type checking in the function registry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tripy Pull request for the tripy project
Projects
None yet
Development

No branches or pull requests

1 participant