You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: ivy.vector_norm and ivy.lgamma when backend=numpy return rounded values #28844
According to array-api, there is no specified behavior when a non-floating point type is given for vector_norm, but I would like to suggest, with all due respect, to stop this casting or to output an error, for the following reasons. (For lgamma, not even defined in array-api.)
There are very limited situations where such behavior is needed.
It does not match the behavior of other functions in numpy; np.sin(1) returns 0.8414709848078965 instead of 0.
This behavior can be easily achieved by ivy.astype(ivy.lgamma(x), dtype=x.dtype)
Package maintainers using ivy need to worry about the type of input, and casts need to be made.
Activity
34j commentedon Nov 29, 2024
(Temporary workaround would be to add
+ 0.to the argument)