Skip to content

Implement numpy.sign equivalent #162

Closed
@ricardoV94

Description

@ricardoV94

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))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions