def is_last(operand, name=''): ''' TBA Example: TBA Args: operand: the symbolic tensor operand denoting a sequence name (str): the name of the node in the network Returns: :class:`cntk.Function` ''' from cntk.cntk_py import is_last operand = sanitize_input(operand, get_data_type(operand)) return is_last(operand, name)
def is_last(seq, name=''): ''' Returns a symbolic sequence of booleans with the same length as ``seq``. The last element of the sequence is 1 and all others are 0. Example: >>> x = C.input_variable(shape=(3,2)) >>> y = C.sequence.is_last(x) >>> x0 = np.reshape(np.arange(24.0,dtype=np.float32),(4,3,2)) >>> y.eval({x:x0}) array([[ 0., 0., 0., 1.]], dtype=float32) Args: seq: the symbolic tensor denoting a sequence name (str): the name of the node in the network Returns: :class:`~cntk.ops.functions.Function` ''' from cntk.cntk_py import is_last seq = sanitize_input(seq, get_data_type(seq)) return is_last(seq, name)
def is_last(seq, name=''): ''' Returns a symbolic sequence of booleans with the same length as ``seq``. The last element of the sequence is 1 and all others are 0. Example: >>> x = C.input_variable(shape=(3,2)) >>> y = C.sequence.is_last(x) >>> # create one sequence of 4 tensors each with shape (3,2) >>> x0 = np.reshape(np.arange(24.0,dtype=np.float32),(1,4,3,2)) >>> y.eval({x:x0}) array([[ 0., 0., 0., 1.]], dtype=float32) Args: seq: the symbolic tensor denoting a sequence name (str): the name of the node in the network Returns: :class:`~cntk.ops.functions.Function` ''' from cntk.cntk_py import is_last seq = sanitize_input(seq, get_data_type(seq)) return is_last(seq, name)