NumPower / numpower

PHP extension for efficient scientific computing and array manipulation with GPU support
https://numpower.org
Other
185 stars 4 forks source link

Arithmetic scalar operations with GPU arrays not supported #22

Closed henrique-borba closed 3 months ago

henrique-borba commented 1 year ago
$a = nd::array([2, 2])->gpu();

$b = $a * 2;

The code above throws an exception because the scalar 2 is converted to a CPU NDArray. I need to implement an automatic scalar "promotion" mechanism for the appropriate device