1 #ifndef CAFFE2_OPERATOR_GLU_OP_H_ 2 #define CAFFE2_OPERATOR_GLU_OP_H_ 4 #include "caffe2/core/context.h" 5 #include "caffe2/core/operator.h" 8 template <
typename T,
class Context>
13 dim_(OperatorBase::GetSingleArgument<int>(
"dim", -1)) {}
15 USE_OPERATOR_CONTEXT_FUNCTIONS;
20 vector<TIndex> Yshape;
21 Yshape.insert(Yshape.end(), X.dims().begin(), X.dims().end());
22 const int split_index = dim_ == -1 ? Yshape.size() - 1 : dim_;
24 Yshape[split_index] % 2 == 0,
27 " should be divided by two");
28 const int split_dim_size = Yshape[split_index] / 2;
29 const int M = X.size_to_dim(split_index);
30 const int N = X.size_from_dim(split_index + 1);
31 Yshape[split_index] = split_dim_size;
38 Y->template mutable_data<T>());
45 const int split_dim_size,
55 #endif // CAFFE2_OPERATOR_GLU_OP_H_
Workspace is a class that holds all the related objects created during runtime: (1) all blobs...
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...