Structs

  • | Given a partitioned tensor $T<N, D_1, | …, D_n>$, where the partitions are | defined as ranges on its outer-most | (slowest varying) dimension $N$, return | a tensor $T<(N + 2 * padding_width), | D_1, …, | | D_n>$ with paddings added to the start | and end of each range. | | Optionally, different paddings can | be provided for beginning and end. | | Paddings provided must be a tensor $T<D_1, | …, | | D_n>$. If no padding is provided, add | zero padding. If no lengths vector is | provided, add padding only once, at | the start and end of data. | | Github Links: | | - https://github.com/pytorch/pytorch/blob/master/caffe2/operators/sequence_ops.cc |
  • | Gather the sum of start and end paddings | in a padded input sequence. Used in order | to compute the gradients of AddPadding | w.r.t the padding tensors. |
  • | Pad empty field given lengths and index | features, | | Input(0) is a blob pointing to the lengths | of samples in one batch, [Input(1),… | Input(num_fields)] a list of tensors | containing the data for each field of | the features. | | PadEmptySamples is thread safe. |
  • | Remove padding around the edges of each | segment of the input data. This is the | reverse operation of AddPadding, | and uses the same arguments and conventions | for input and output data format. | | Github Links: | | - https://github.com/pytorch/pytorch/blob/master/caffe2/operators/sequence_ops.cc |