def last(seq, name=''): ''' Returns the last element of its symbolic input sequence `seq` Example: >>> import cntk.ops as C >>> import numpy as np >>> x = C.input_variable(shape=(3,2)) >>> y = C.sequence.last(x) >>> x0 = np.reshape(np.arange(24.0,dtype=np.float32),(4,3,2)) >>> y.eval({x:x0}) array([[[[ 18., 19.], [ 20., 21.], [ 22., 23.]]]], dtype=float32) Args: seq: the symbolic tensor denoting a sequence name (str): the name of the node in the network Returns: :class:`cntk.Function` ''' from cntk.cntk_py import last seq = sanitize_input(seq, get_data_type(seq)) return last(seq, name)
def last(seq, name=''): ''' Returns the last element of its symbolic input sequence ``seq`` Example: >>> import cntk.ops as C >>> import numpy as np >>> x = C.input_variable(shape=(3,2)) >>> y = C.sequence.last(x) >>> x0 = np.reshape(np.arange(24.0,dtype=np.float32),(4,3,2)) >>> y.eval({x:x0}) array([[[[ 18., 19.], [ 20., 21.], [ 22., 23.]]]], dtype=float32) Args: seq: the symbolic tensor denoting a sequence name (str): the name of the node in the network Returns: :class:`cntk.Function` ''' from cntk.cntk_py import last seq = sanitize_input(seq, get_data_type(seq)) return last(seq, name)
def 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 last operand = sanitize_input(operand, get_data_type(operand)) return last(operand, name)
def last(seq, name=''): ''' Returns the last element of its symbolic input sequence ``seq`` Example: >>> x = C.sequence.input(shape=(3,2)) >>> y = C.sequence.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([[[ 18., 19.], [ 20., 21.], [ 22., 23.]]], 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 last seq = sanitize_input(seq, get_data_type(seq)) return last(seq, name)