2 #ifndef CAFFE2_OPERATORS_RECURRENT_NETWORK_EXECUTOR_INCL_H_ 3 #define CAFFE2_OPERATORS_RECURRENT_NETWORK_EXECUTOR_INCL_H_ 6 #include "caffe2/core/operator.h" 15 std::shared_ptr<OperatorBase> op =
nullptr;
19 int num_dynamic_inputs = 0;
20 int num_recurrent_inputs = 0;
21 std::atomic<int> proc_inputs;
25 std::vector<int> dependencies;
26 std::vector<int> parents;
28 bool has_timestep_blob =
false;
30 explicit RNNNetOperator(
const OperatorDef& def,
int order) : order(order) {
32 link_op = def.type() ==
"rnn_internal_apply_link";
39 num_dynamic_inputs = x.num_dynamic_inputs;
40 num_recurrent_inputs = x.num_recurrent_inputs;
42 dependencies = x.dependencies;
44 frontier = x.frontier;
58 OpTask(
int _timestep,
int _op_idx,
int _T,
int _direction)
59 : timestep(_timestep), op_idx(_op_idx), T(_T), direction(_direction) {
60 CAFFE_ENFORCE(direction == 1 || direction == -1);
61 CAFFE_ENFORCE(timestep >= 0 && timestep < _T);
64 inline bool backward() {
65 return direction == -1;
67 inline bool forward() {
68 return direction == 1;
74 #endif // CAFFE2_OPERATORS_RECURRENT_NETWORK_EXECUTOR_H_ Struct for operator in a timestep and its dependenceis.
Data structure for a scheduled task in the task queue.
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...