1 #include <caffe2/ideep/operators/operator_fallback_ideep.h> 2 #include <caffe2/ideep/utils/ideep_operator.h> 4 #include <caffe2/operators/abs_op.h> 5 #include <caffe2/operators/accuracy_op.h> 6 #include <caffe2/operators/affine_channel_op.h> 7 #include <caffe2/operators/atan_op.h> 8 #include <caffe2/operators/batch_matmul_op.h> 9 #include <caffe2/operators/cast_op.h> 10 #include <caffe2/operators/clip_op.h> 11 #include <caffe2/operators/collect_and_distribute_fpn_rpn_proposals_op.h> 12 #include <caffe2/operators/cross_entropy_op.h> 13 #include <caffe2/operators/ctc_beam_search_decoder_op.h> 14 #include <caffe2/operators/ctc_greedy_decoder_op.h> 15 #include <caffe2/operators/distance_op.h> 16 #include <caffe2/operators/dropout_op.h> 17 #include <caffe2/operators/elementwise_add_op.h> 18 #include <caffe2/operators/elementwise_div_op.h> 19 #include <caffe2/operators/elementwise_mul_op.h> 20 #include <caffe2/operators/elementwise_ops.h> 21 #include <caffe2/operators/elementwise_sub_op.h> 22 #include <caffe2/operators/expand_op.h> 23 #include <caffe2/operators/filler_op.h> 24 #include <caffe2/operators/flatten_op.h> 25 #include <caffe2/operators/gather_op.h> 26 #include <caffe2/operators/generate_proposals_op.h> 27 #include <caffe2/operators/given_tensor_fill_op.h> 28 #include <caffe2/operators/load_save_op.h> 29 #include <caffe2/operators/loss_op.h> 30 #include <caffe2/operators/normalize_op.h> 31 #include <caffe2/operators/order_switch_ops.h> 32 #include <caffe2/operators/pad_op.h> 33 #include <caffe2/operators/prelu_op.h> 34 #include <caffe2/operators/reduce_ops.h> 35 #include <caffe2/operators/rmac_regions_op.h> 36 #include <caffe2/operators/roi_align_op.h> 37 #include <caffe2/operators/roi_align_rotated_op.h> 38 #include <caffe2/operators/roi_pool_op.h> 39 #include <caffe2/operators/scale_op.h> 40 #include <caffe2/operators/slice_op.h> 41 #include <caffe2/operators/softmax_op.h> 42 #include <caffe2/operators/softmax_with_loss_op.h> 43 #include <caffe2/operators/sqrt_op.h> 44 #include <caffe2/operators/stop_gradient.h> 45 #include <caffe2/operators/tanh_op.h> 46 #include <caffe2/operators/tensor_protos_db_input.h> 47 #include <caffe2/operators/transpose_op.h> 48 #include <caffe2/operators/utility_ops.h> 49 #include <caffe2/queue/queue_ops.h> 50 #include <caffe2/sgd/iter_op.h> 51 #include <caffe2/sgd/learning_rate_op.h> 52 #include "caffe2/operators/bbox_transform_op.h" 53 #include "caffe2/operators/box_with_nms_limit_op.h" 55 #ifdef CAFFE2_USE_GLOO 56 #include <caffe2/contrib/gloo/common_world_ops.h> 57 #include <caffe2/contrib/gloo/broadcast_ops.h> 58 #include <caffe2/contrib/gloo/allreduce_ops.h> 59 #include <caffe2/contrib/gloo/allgather_ops.h> 60 #include <caffe2/contrib/gloo/barrier_ops.h> 61 #include <caffe2/contrib/gloo/reduce_scatter_ops.h> 68 REGISTER_IDEEP_COMPARE_OPERATOR(EQ);
69 REGISTER_IDEEP_COMPARE_OPERATOR(GT);
70 REGISTER_IDEEP_COMPARE_OPERATOR(GE);
71 REGISTER_IDEEP_COMPARE_OPERATOR(LT);
72 REGISTER_IDEEP_COMPARE_OPERATOR(LE);
73 REGISTER_IDEEP_COMPARE_OPERATOR(NE);
75 REGISTER_IDEEP_OPERATOR(
Softmax, IDEEPFallbackOp<SoftmaxOp<float, CPUContext>>);
76 REGISTER_IDEEP_OPERATOR(
78 IDEEPFallbackOp<LabelCrossEntropyOp<float, CPUContext>>);
79 REGISTER_IDEEP_OPERATOR(
81 IDEEPFallbackOp<AveragedLoss<float, CPUContext>, SkipIndices<0>>);
82 REGISTER_IDEEP_OPERATOR(
Flatten, IDEEPFallbackOp<FlattenOp<CPUContext>>);
83 REGISTER_IDEEP_OPERATOR(ResizeLike, IDEEPFallbackOp<ResizeLikeOp<CPUContext>>);
84 REGISTER_IDEEP_OPERATOR(Transpose, IDEEPFallbackOp<TransposeOp<CPUContext>>);
85 REGISTER_IDEEP_OPERATOR(Slice, IDEEPFallbackOp<SliceOp<CPUContext>>);
86 REGISTER_IDEEP_OPERATOR(
Clip, IDEEPFallbackOp<ClipOp<float, CPUContext>>);
87 REGISTER_IDEEP_OPERATOR(
89 IDEEPFallbackOp<ScatterAssignOp<CPUContext>>);
90 REGISTER_IDEEP_OPERATOR(
92 IDEEPFallbackOp<CastOp<CPUContext>>);
95 REGISTER_IDEEP_OPERATOR(
97 IDEEPFallbackOp<XavierFillOp<float, CPUContext>>);
98 REGISTER_IDEEP_OPERATOR(
100 IDEEPFallbackOp<ConstantFillOp<CPUContext>>);
101 REGISTER_IDEEP_OPERATOR(
103 IDEEPFallbackOp<GaussianFillOp<float, CPUContext>>);
104 REGISTER_IDEEP_OPERATOR(
106 IDEEPFallbackOp<MSRAFillOp<float, CPUContext>>);
107 REGISTER_IDEEP_OPERATOR(
109 IDEEPFallbackOp<GivenTensorFillOp<float, CPUContext>>);
111 REGISTER_IDEEP_OPERATOR(
112 GivenTensorDoubleFill,
113 IDEEPFallbackOp<GivenTensorFillOp<double, CPUContext>, SkipIndices<0>>);
114 REGISTER_IDEEP_OPERATOR(
116 IDEEPFallbackOp<GivenTensorFillOp<bool, CPUContext>, SkipIndices<0>>);
117 REGISTER_IDEEP_OPERATOR(
119 IDEEPFallbackOp<GivenTensorFillOp<int, CPUContext>, SkipIndices<0>>);
120 REGISTER_IDEEP_OPERATOR(
121 GivenTensorInt64Fill,
122 IDEEPFallbackOp<GivenTensorFillOp<int64_t, CPUContext>, SkipIndices<0>>);
123 REGISTER_IDEEP_OPERATOR(
124 GivenTensorStringFill,
125 IDEEPFallbackOp<GivenTensorFillOp<std::string, CPUContext>, SkipIndices<0>>);
126 REGISTER_IDEEP_OPERATOR(Load, IDEEPFallbackOp<LoadOp<CPUContext>>);
127 REGISTER_IDEEP_OPERATOR(Save, IDEEPFallbackOp<SaveOp<CPUContext>>);
129 REGISTER_IDEEP_OPERATOR(
131 IDEEPFallbackOp<RMACRegionsOp<CPUContext>>);
132 REGISTER_IDEEP_OPERATOR(RoIPool, IDEEPFallbackOp<RoIPoolOp<float, CPUContext>>);
133 REGISTER_IDEEP_OPERATOR(
135 IDEEPFallbackOp<RoIAlignOp<float, CPUContext>>);
136 REGISTER_IDEEP_OPERATOR(
138 IDEEPFallbackOp<RoIAlignRotatedOp<float, CPUContext>>);
139 REGISTER_IDEEP_OPERATOR(
141 IDEEPFallbackOp<GenerateProposalsOp<CPUContext>>);
142 REGISTER_IDEEP_OPERATOR(
143 GenerateProposalsCPP,
144 IDEEPFallbackOp<GenerateProposalsOp<CPUContext>>);
145 REGISTER_IDEEP_OPERATOR(
146 CollectAndDistributeFpnRpnProposals,
147 IDEEPFallbackOp<CollectAndDistributeFpnRpnProposalsOp<CPUContext>>);
148 REGISTER_IDEEP_OPERATOR(
150 IDEEPFallbackOp<BoxWithNMSLimitOp<CPUContext>, SkipIndices<0,1,2>>);
151 REGISTER_IDEEP_OPERATOR(
153 IDEEPFallbackOp<BBoxTransformOp<float, CPUContext>>);
154 REGISTER_IDEEP_OPERATOR(
156 IDEEPFallbackOp<AffineChannelOp<float, CPUContext>>);
157 REGISTER_IDEEP_OPERATOR(
159 IDEEPFallbackOp<StopGradientOp<CPUContext>>);
161 REGISTER_IDEEP_OPERATOR(
163 IDEEPFallbackOp<PadImageOp<float, CPUContext>>);
164 REGISTER_IDEEP_OPERATOR(
166 IDEEPFallbackOp<PReluOp<float, CPUContext>>);
169 REGISTER_IDEEP_OPERATOR(
171 IDEEPFallbackOp<CTCGreedyDecoderOp<CPUContext>>);
172 REGISTER_IDEEP_OPERATOR(
173 CTCBeamSearchDecoder,
174 IDEEPFallbackOp<CTCBeamSearchDecoderOp<CPUContext>>);
176 REGISTER_IDEEP_OPERATOR(
177 AveragedLossGradient,
178 IDEEPFallbackOp<AveragedLossGradient<float, CPUContext>>);
179 REGISTER_IDEEP_OPERATOR(
180 LabelCrossEntropyGradient,
181 IDEEPFallbackOp<LabelCrossEntropyGradientOp<float, CPUContext>>);
182 REGISTER_IDEEP_OPERATOR(
184 IDEEPFallbackOp<SoftmaxGradientOp<float, CPUContext>>);
185 REGISTER_IDEEP_OPERATOR(
187 IDEEPFallbackOp<IterOp<CPUContext>>);
188 REGISTER_IDEEP_OPERATOR(
190 IDEEPFallbackOp<LearningRateOp<float, CPUContext>>);
191 REGISTER_IDEEP_OPERATOR(
193 IDEEPFallbackOp<UnaryElementwiseOp<
194 TensorTypes<float>, CPUContext, AbsFunctor<CPUContext>>>);
195 REGISTER_IDEEP_OPERATOR(
197 IDEEPFallbackOp<UnaryElementwiseOp<
198 TensorTypes<float>, CPUContext, AtanFunctor<CPUContext>>>);
199 REGISTER_IDEEP_OPERATOR(
201 IDEEPFallbackOp<UnaryElementwiseOp<
202 TensorTypes<float>, CPUContext, SqrtFunctor<CPUContext>>>);
203 REGISTER_IDEEP_OPERATOR(
205 IDEEPFallbackOp<BinaryElementwiseOp<
206 NumericTypes, CPUContext, DivFunctor<CPUContext>>>);
207 REGISTER_IDEEP_OPERATOR(
210 BinaryElementwiseOp<NumericTypes, CPUContext, MulFunctor<CPUContext>>>);
211 REGISTER_IDEEP_OPERATOR(
213 IDEEPFallbackOp<BinaryElementwiseOp<
214 NumericTypes, CPUContext, SubFunctor<CPUContext>>>);
215 REGISTER_IDEEP_OPERATOR(
217 IDEEPFallbackOp<UnaryElementwiseOp<
220 TanhFunctor<CPUContext>>>);
221 REGISTER_IDEEP_OPERATOR(
223 IDEEPFallbackOp<L1DistanceOp<float, CPUContext>>);
224 REGISTER_IDEEP_OPERATOR(Scale, IDEEPFallbackOp<ScaleOp<CPUContext>>);
225 REGISTER_IDEEP_OPERATOR(
227 IDEEPFallbackOp<AccuracyOp<float, CPUContext>>);
229 REGISTER_IDEEP_OPERATOR(
231 IDEEPFallbackOp<BinaryElementwiseGradientOp<
234 AddFunctor<CPUContext>>>);
235 REGISTER_IDEEP_OPERATOR(
237 IDEEPFallbackOp<BinaryElementwiseOp<
240 TanhGradientFunctor<CPUContext>>>);
241 REGISTER_IDEEP_OPERATOR(
243 IDEEPFallbackOp<BinaryElementwiseGradientOp<
246 MulFunctor<CPUContext>>>);
247 REGISTER_IDEEP_OPERATOR(TensorProtosDBInput, IDEEPFallbackOp<TensorProtosDBInput<CPUContext>>);
248 REGISTER_IDEEP_OPERATOR(CloseBlobsQueue, IDEEPFallbackOp<CloseBlobsQueueOp<CPUContext>>);
249 REGISTER_IDEEP_OPERATOR(
251 IDEEPFallbackOp<SoftmaxWithLossOp<float, CPUContext>>);
252 REGISTER_IDEEP_OPERATOR(
253 SoftmaxWithLossGradient,
254 IDEEPFallbackOp<SoftmaxWithLossGradientOp<float, CPUContext>>);
255 REGISTER_IDEEP_OPERATOR(
257 IDEEPFallbackOp<NHWC2NCHWOp<float, CPUContext>>);
258 REGISTER_IDEEP_OPERATOR(
260 IDEEPFallbackOp<NCHW2NHWCOp<float, CPUContext>>);
262 REGISTER_IDEEP_OPERATOR(
264 IDEEPFallbackOp<ExpandOp<
265 TensorTypes<std::int32_t, std::int64_t, float, double>,
267 REGISTER_IDEEP_OPERATOR(Gather, IDEEPFallbackOp<GatherOp<CPUContext>>);
269 REGISTER_IDEEP_OPERATOR(
271 IDEEPFallbackOp<NormalizeOp<float, CPUContext>>);
272 REGISTER_IDEEP_OPERATOR(
275 ReduceOp<TensorTypes<float>, CPUContext, L2Reducer<CPUContext>>>);
276 REGISTER_IDEEP_OPERATOR(
278 IDEEPFallbackOp<ReduceOp<
279 TensorTypes<std::int32_t, std::int64_t, float, double>,
281 SumReducer<CPUContext>>>);
282 REGISTER_IDEEP_OPERATOR(
284 IDEEPFallbackOp<ReduceOp<
285 TensorTypes<float>, CPUContext, MeanReducer<CPUContext>>>);
286 REGISTER_IDEEP_OPERATOR(
288 IDEEPFallbackOp<BatchMatMulOp<CPUContext>>);
290 #ifdef CAFFE2_USE_GLOO 293 REGISTER_IDEEP_OPERATOR(
295 IDEEPFallbackOp<CreateCommonWorld<CPUContext>, SkipIndices<0>>);
296 REGISTER_IDEEP_OPERATOR(
298 IDEEPFallbackOp<CloneCommonWorld<CPUContext>, SkipIndices<0>>);
299 REGISTER_IDEEP_OPERATOR(
301 IDEEPFallbackOp<DestroyCommonWorld>);
302 REGISTER_IDEEP_OPERATOR(
304 IDEEPFallbackOp<BroadcastOp<CPUContext>>);
305 REGISTER_IDEEP_OPERATOR(
307 IDEEPFallbackOp<AllreduceOp<CPUContext>>);
308 REGISTER_IDEEP_OPERATOR(
310 IDEEPFallbackOp<AllgatherOp<CPUContext>>);
311 REGISTER_IDEEP_OPERATOR(
313 IDEEPFallbackOp<BarrierOp<CPUContext>>);
314 REGISTER_IDEEP_OPERATOR(
316 IDEEPFallbackOp<ReduceScatterOp<CPUContext>>);
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...