File tree Expand file tree Collapse file tree 3 files changed +4
-9
lines changed
Expand file tree Collapse file tree 3 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -100,10 +100,7 @@ unique_ptr<OperatorBase> TryCreateC2Operator(
100100
101101unique_ptr<OperatorBase> TryCreateC10Operator (
102102 const string& key, const OperatorDef& operator_def, Workspace* ws) {
103- if (auto op = C10OperatorRegistry ()->Create (key, operator_def, ws)) {
104- return op;
105- }
106- return nullptr ;
103+ return C10OperatorRegistry ()->Create (key, operator_def, ws);
107104}
108105
109106unique_ptr<OperatorBase> TryCreateOperator (
Original file line number Diff line number Diff line change 11#pragma once
22
3- #include " .. /core/tensor.h"
3+ #include " caffe2 /core/tensor.h"
44#include " caffe2/utils/Array.h"
55
66namespace caffe2 {
77
88struct SigmoidOp final {
99 static constexpr const char * name = " sigmoid" ;
1010
11- using Signature = bool (Tensor<CPUContext> input, Tensor<CPUContext>* output);
11+ using Signature = void (Tensor<CPUContext> input, Tensor<CPUContext>* output);
1212
1313 static constexpr c10::guts::array<const char *, 2 > parameter_names = {{" input" , " output" }};
1414};
Original file line number Diff line number Diff line change @@ -7,13 +7,11 @@ using caffe2::CPUContext;
77
88namespace {
99template <class DataType >
10- bool sigmoid_op_cpu_impl (Tensor<CPUContext> input, Tensor<CPUContext> *output) {
10+ void sigmoid_op_cpu_impl (Tensor<CPUContext> input, Tensor<CPUContext> *output) {
1111 output->ResizeLike (input);
1212
1313 caffe2::ConstEigenVectorArrayMap<DataType> xM (input.data <DataType>(), input.size ());
1414 caffe2::EigenVectorArrayMap<DataType>(output->mutable_data <DataType>(), input.size ()) = 1 . / (1 . + (-xM).exp ());
15-
16- return true ;
1715}
1816} // namespace
1917
You can’t perform that action at this time.
0 commit comments