Caffe2 - C++ API
A deep learning, cross platform ML framework
given_tensor_fill_op.cc
1 #include "caffe2/operators/given_tensor_fill_op.h"
2 
3 namespace caffe2 {
4 
5 REGISTER_CPU_OPERATOR(GivenTensorFill, GivenTensorFillOp<float, CPUContext>);
6 REGISTER_CPU_OPERATOR(
7  GivenTensorDoubleFill,
8  GivenTensorFillOp<double, CPUContext>);
9 REGISTER_CPU_OPERATOR(GivenTensorBoolFill, GivenTensorFillOp<bool, CPUContext>);
10 REGISTER_CPU_OPERATOR(GivenTensorIntFill, GivenTensorFillOp<int, CPUContext>);
11 REGISTER_CPU_OPERATOR(
12  GivenTensorInt64Fill,
13  GivenTensorFillOp<int64_t, CPUContext>);
14 REGISTER_CPU_OPERATOR(
15  GivenTensorStringFill,
16  GivenTensorFillOp<std::string, CPUContext>);
17 
18 NO_GRADIENT(GivenTensorFill);
19 NO_GRADIENT(GivenTensorDoubleFill);
20 NO_GRADIENT(GivenTensorBoolFill);
21 NO_GRADIENT(GivenTensorIntFill);
22 NO_GRADIENT(GivenTensorInt64Fill);
23 NO_GRADIENT(GivenTensorStringFill);
24 
25 OPERATOR_SCHEMA(GivenTensorFill)
26  .NumInputs(0, 1)
27  .NumOutputs(1)
28  .AllowInplace({{0, 0}})
29  .TensorInferenceFunction(FillerTensorInference<>);
30 OPERATOR_SCHEMA(GivenTensorDoubleFill)
31  .NumInputs(0, 1)
32  .NumOutputs(1)
33  .AllowInplace({{0, 0}})
34  .TensorInferenceFunction(
35  FillerTensorInference<TensorProto_DataType_DOUBLE>);
36 OPERATOR_SCHEMA(GivenTensorBoolFill)
37  .NumInputs(0, 1)
38  .NumOutputs(1)
39  .AllowInplace({{0, 0}})
40  .TensorInferenceFunction(FillerTensorInference<TensorProto_DataType_BOOL>);
41 OPERATOR_SCHEMA(GivenTensorIntFill)
42  .NumInputs(0, 1)
43  .NumOutputs(1)
44  .AllowInplace({{0, 0}})
45  .TensorInferenceFunction(FillerTensorInference<TensorProto_DataType_INT32>);
46 OPERATOR_SCHEMA(GivenTensorInt64Fill)
47  .NumInputs(0, 1)
48  .NumOutputs(1)
49  .AllowInplace({{0, 0}})
50  .TensorInferenceFunction(FillerTensorInference<TensorProto_DataType_INT64>);
51 OPERATOR_SCHEMA(GivenTensorStringFill)
52  .NumInputs(0, 1)
53  .NumOutputs(1)
54  .AllowInplace({{0, 0}})
55  .TensorInferenceFunction(
56  FillerTensorInference<TensorProto_DataType_STRING>);
57 
58 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...