コード例 #1
0
ファイル: __init__.py プロジェクト: ironhide23586/CNTK
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
コード例 #2
0
ファイル: __init__.py プロジェクト: nikolayvoronchikhin/CNTK
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