def abs(x, name=None): """ Computes the element-wise absolute of `x`: :math:`abs(x) = |x|` Example: >>> C.eval(C.abs([-1, 1, -2, 3])) [array([[ 1., 1., 2., 3.]])] Args: x: any :class:`cntk.graph.ComputationNode` that outputs a tensor Returns: :class:`cntk.graph.ComputationNode` """ from cntk.ops.cntk2 import Abs op = Abs(x, name=name) wrap_numpy_arrays(op) op.rank = op._.rank return op