finch-tensor / finch-tensor-python

Sparse and Structured Tensor Programming in Python
MIT License
8 stars 3 forks source link

Add `device` and `to_device`. Python scalars casting. #65

Closed mtsokol closed 4 months ago

mtsokol commented 4 months ago

Hi @hameerabbasi,

This PR introduces changes that we discussed some time ago: renames current to_device() to to_storage() used for changing the storage, and introduces Array API compatible to_device() and device property (also needed for array-api-tests).

There's also a small fix for avoiding unwanted type promotion when executing: Tensor + python scalar to align with Array API.