Table Of Contents
Table Of Contents

mxnet.ndarray.sparse.sign

mxnet.ndarray.sparse.sign(data=None, out=None, name=None, **kwargs)

Returns element-wise sign of the input.

Example:

sign([-2, 0, 3]) = [-1, 0, 1]

The storage type of sign output depends upon the input storage type:

  • sign(default) = default

  • sign(row_sparse) = row_sparse

  • sign(csr) = csr

Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L695

Parameters
  • data (NDArray) – The input array.

  • out (NDArray, optional) – The output NDArray to hold the result.

Returns

out – The output of this function.

Return type

NDArray or list of NDArrays