def tanh(x, name=None): """ Computes the element-wise tanh of `x`: The output tensor has the same shape as `x`. Example: >>> C.eval(C.tanh([[1,2],[3,4]])) [array([[[ 0.761594, 0.964028], [ 0.995055, 0.999329]]])] Args: x: any :class:`cntk.graph.ComputationNode` that outputs a tensor Returns: :class:`cntk.graph.ComputationNode` """ from cntk.ops.cntk2 import Tanh op = Tanh(x, name=name) wrap_numpy_arrays(op) op.rank = op._.rank return op