Closed
Description
Description
This seems to be missing: https://numpy.org/doc/stable/reference/generated/numpy.sign.html
Something like this should work?
def sign(x):
return pt.switch(pt.eq(x, 0), 0, pt.switch(x > 0, 1, -1))
This seems to be missing: https://numpy.org/doc/stable/reference/generated/numpy.sign.html
Something like this should work?
def sign(x):
return pt.switch(pt.eq(x, 0), 0, pt.switch(x > 0, 1, -1))