1 #include "caffe2/operators/replace_nan_op.h" 7 void ReplaceNaNOp<CPUContext>::ReplaceNaN(
12 for (int64_t i = 0; i < size; i++) {
13 if (std::isnan(X[i])) {
21 REGISTER_CPU_OPERATOR(ReplaceNaN, ReplaceNaNOp<CPUContext>);
23 OPERATOR_SCHEMA(ReplaceNaN)
26 .AllowInplace({{0, 0}})
27 .IdenticalTypeAndShape()
29 Replace the NaN (not a number) element in the input tensor with argument `value` 31 .Arg("value (optional)",
"the value to replace NaN, the default is 0")
32 .Input(0,
"input",
"Input tensor")
33 .Input(1,
"output",
"Output tensor");
35 SHOULD_NOT_DO_GRADIENT(ReplaceNaN);
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...