NumPower / numpower

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

Broadcasting fixes and updates #35

Closed henrique-borba closed 1 year ago

henrique-borba commented 1 year ago

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

fix: Scalar broadcast not working properly. @henrique-borba

Operations like the one below were getting unexpected results due a bug in the AVX2 loop and broadcasting.

$x = nd::array([[1. 2], [3, 4]])
$x = 1 - nd::exp(-$x);

The broadcast engine has also been updated to expand the capabilities of broadcasting between 2D NDArrays.