Backends/SiaNet.Backend.MxNet/NDArrayOps.cs
/// <summary>
/// Takes the last element of a sequence.This function takes an n-dimensional input array of the form[max_sequence_length, batch_size, other_feature_dims] and returns a (n-1)-dimensional arrayof the form [batch_size, other_feature_dims].Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length` should bean input array of positive ints of dimension [batch_size]. To use this parameter,set `use_sequence_length` to `True`, otherwise each example in the batch is assumedto have the max sequence length... note:: Alternatively, you can also use `take` operator.Example::   x = [[[  1.,   2.,   3.],         [  4.,   5.,   6.],         [  7.,   8.,   9.]],        [[ 10.,   11.,   12.],         [ 13.,   14.,   15.],         [ 16.,   17.,   18.]],        [[  19.,   20.,   21.],         [  22.,   23.,   24.],         [  25.,   26.,   27.]]]   // returns last sequence when sequence_length parameter is not used   SequenceLast(x) = [[  19.,   20.,   21.],                      [  22.,   23.,   24.],                      [  25.,   26.,   27.]]   // sequence_length y is used   SequenceLast(x, y=[1,1,1], use_sequence_length=True) =            [[  1.,   2.,   3.],             [  4.,   5.,   6.],             [  7.,   8.,   9.]]   // sequence_length y is used   SequenceLast(x, y=[1,2,3], use_sequence_length=True) =            [[  1.,    2.,   3.],             [  13.,  14.,  15.],             [  25.,  26.,  27.]]Defined in G:\deeplearn\mxnet\src\operator\sequence_last.cc:L91
/// </summary>
/// <param name="@out">output NDArray</param>
/// <param name="data">n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims] where n>2</param>
/// <param name="sequence_length">vector of sequence lengths of the form [batch_size]</param>
/// <param name="use_sequence_length">If set to true, this layer takes in an extra input parameter `sequence_length` to specify variable length sequence</param>
/// <returns>returns new symbol</returns>
Takes the last element of a sequence.This function takes an n-dimensional input array of the form[max_sequence_length, batch_size, other_feature_dims] and returns a (n-1)-dimensional arrayof the form [batch_size, other_feature_dims].Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length` should bean input array of positive ints of dimension [batch_size]. To use this parameter,set `use_sequence_length` to `True`, otherwise each example in the batch is assumedto have the max sequence length...
Takes the last element of a sequence . This function takes an n - dimensional input array of the form [ max_sequence_length batch_size other_feature_dims ] and returns a ( n - 1 ) - dimensional arrayof the form [ batch_size other_feature_dims ] . Parameter ` sequence_length ` is used to handle variable - length sequences . ` sequence_length ` should bean input array of positive ints of dimension [ batch_size ] . To use this parameter set ` use_sequence_length ` to ` True ` otherwise each example in the batch is assumedto have the max sequence length ...
public static NDArray SequenceLast(NDArray @out,
        NDArray data,
        NDArray sequence_length,
        bool use_sequence_length = false)
        {
            return new Operator("SequenceLast")
            .SetParam("use_sequence_length", use_sequence_length)
            .SetInput("data", data)
            .SetInput("sequence_length", sequence_length)
            .Invoke(@out);
        }
public static NDArray SequenceLast ( NDArray @out , NDArray data , NDArray sequence_length , bool use_sequence_length = false ) { return new Operator ( " " ) . SetParam ( " " , use_sequence_length ) . SetInput ( " " , data ) . SetInput ( " " , sequence_length ) . Invoke ( @out ) ; }
Takes the last element of a sequence.This function takes an n-dimensional input array of the form[max_sequence_length, batch_size, other_feature_dims] and returns a (n-1)-dimensional arrayof the form [batch_size, other_feature_dims].Parameter `sequence_length` is used to handle variable-length sequences.
Takes the last element of a sequence . This function takes an n - dimensional input array of the form [ max_sequence_length batch_size other_feature_dims ] and returns a ( n - 1 ) - dimensional arrayof the form [ batch_size other_feature_dims ] . Parameter ` sequence_length ` is used to handle variable - length sequences .
returns new symbol
returns new symbol
@out
NDArray
None
data
NDArray
n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims] where n>2
n - dimensional input array of the form [ max_sequence_length batch_size other_feature_dims ] where n > 2
sequence_length
NDArray
vector of sequence lengths of the form [batch_size]
vector of sequence lengths of the form [ batch_size ]
use_sequence_length
bool
If set to true, this layer takes in an extra input parameter `sequence_length` to specify variable length sequence
If set to true this layer takes in an extra input parameter ` sequence_length ` to specify variable length sequence