Caffe2 - C++ API
A deep learning, cross platform ML framework
variable_length_sequence_padding.cc
1 #include "variable_length_sequence_padding.h"
2 
3 namespace caffe2 {
4 REGISTER_CPU_OPERATOR(
5  VariableLengthSequencePadding,
6  VariableLengthSequencePaddingOp<float, CPUContext>);
7 OPERATOR_SCHEMA(VariableLengthSequencePadding)
8  .NumInputs(2)
9  .NumOutputs(1)
10  .AllowInplace({{0, 0}})
11  .SetDoc(R"DOC(
12 Super special-case operator. Used to pad a tensor to mimic pytorch's
13 pad_packed_sequence.
14 
15 Given an input tensor INPUT of size NxBxM and an input tensor LENS
16 of size B, where
17 
18 N = maximum sequence length
19 B = batch size
20 M = hidden size
21 
22 set each element of INPUT to zero if it is is past the end of the
23 corresponding sequence (i.e. if LENS[j] > i for an index (i,j,k)).
24 
25 )DOC");
26 
27 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13