コード例 #1
0
ファイル: __init__.py プロジェクト: msincenselee/CNTK
def floor(arg, name=None):
    """
    The output of this operation is the element wise value rounded to the largest 
    integer less than or equal to the input.

    Example:
        >>> C.eval(C.floor([0.2, 1.3, 4., 5.5, 0.0]))
        [array([[ 0.,  1.,  4.,  5.,  0.]])]

        >>> C.eval(C.floor([[0.6, 3.3], [1.9, 5.6]]))
        [array([[[ 0.,  3.],
                 [ 1.,  5.]]])]

        >>> C.eval(C.floor([-5.5, -4.2, -3., -0.7, 0]))
        [array([[-6., -5., -3., -1.,  0.]])]

        >>> C.eval(C.floor([[-0.6, -4.3], [1.9, -3.2]]))
        [array([[[-1., -5.],
                 [ 1., -4.]]])]

    Args:
        arg: input tensor
        name (str): the name of the node in the network (optional)
    Returns:
        :class:`cntk.graph.ComputationNode`
    """
    from cntk.ops.cntk2 import Floor
    op = Floor(arg, name=name)
    wrap_numpy_arrays(op)
    op.rank = op._.rank
    return op
コード例 #2
0
ファイル: __init__.py プロジェクト: ironhide23586/CNTK
def floor(arg, name=None):
    """
    The output of this operation is the element wise value rounded to the largest 
    integer less than or equal to the input.

    Example:
        >>> C.eval(C.floor([0.2, 1.3, 4., 5.5, 0.0]))
        [array([[ 0.,  1.,  4.,  5.,  0.]])]

        >>> C.eval(C.floor([[0.6, 3.3], [1.9, 5.6]]))
        [array([[[ 0.,  3.],
                 [ 1.,  5.]]])]

        >>> C.eval(C.floor([-5.5, -4.2, -3., -0.7, 0]))
        [array([[-6., -5., -3., -1.,  0.]])]

        >>> C.eval(C.floor([[-0.6, -4.3], [1.9, -3.2]]))
        [array([[[-1., -5.],
                 [ 1., -4.]]])]

    Args:
        arg: input tensor
        name: the name of the node in the network (optional)
    Returns:
        :class:`cntk.graph.ComputationNode`
    """
    from cntk.ops.cntk2 import Floor
    op = Floor(arg, name = name)
    wrap_numpy_arrays(op)    
    op.rank = op._.rank  
    return op