NumPower / numpower

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

NDArray::standard_normal() 'expects at most 3 arguments' bugfix #54

Closed SkibidiProduction closed 2 months ago

SkibidiProduction commented 2 months ago

This pull request is bugfix for:

code

$a = \NDArray::standard_normal([4, 4]);

output

Fatal error: Uncaught ArgumentCountError: NDArray::standard_normal() expects at most 3 arguments, 1 given in ...

This behavior is contrary to the documentation and now it works like this:

code

$a = \NDArray::standard_normal([4, 4]);
echo $a;

output

[[0.707728, -0.824689, 2.67663, 0.515145]
 [0.138282, 0.552082, 2.00242, -0.128967]
 [-0.166174, 0.838472, 0.110919, 0.119925]
 [1.03467, 1.4856, -1.07519, 0.89256]]