diff options
Diffstat (limited to 'reference_model')
-rw-r--r-- | reference_model/src/ops/activation_funcs.cc | 28 | ||||
-rw-r--r-- | reference_model/src/ops/activation_funcs.h | 20 | ||||
-rw-r--r-- | reference_model/src/ops/op_factory.cc | 4 |
3 files changed, 0 insertions, 52 deletions
diff --git a/reference_model/src/ops/activation_funcs.cc b/reference_model/src/ops/activation_funcs.cc index 440f4e1..21677d5 100644 --- a/reference_model/src/ops/activation_funcs.cc +++ b/reference_model/src/ops/activation_funcs.cc @@ -51,31 +51,6 @@ int OpClamp<Rank, Dtype>::register_fcn() } template <int Rank, DType Dtype> -int OpReluN<Rank, Dtype>::register_fcn() -{ - - switch (Dtype) - { - case DType_FLOAT: - { - InEigenType N = (InEigenType)attribute->max_fp(); - this->fcn = [N](InEigenType a) -> OutEigenType { return a >= 0 ? (a <= N ? a : N) : 0; }; - } - break; - case DType_INT32: - { - InEigenType N = (InEigenType)attribute->max_int(); - this->fcn = [N](InEigenType a) -> OutEigenType { return a >= 0 ? (a <= N ? a : N) : 0; }; - } - break; - default: - ERROR_IF(true, "unsupported DType %s", EnumNamesDType()[Dtype]); - } - - return 0; -} - -template <int Rank, DType Dtype> int OpSigmoid<Rank, Dtype>::register_fcn() { switch (Dtype) @@ -110,9 +85,6 @@ DEF_INSTANTIATE_RANK0_6_ONE_RANK_ONE_TYPE(OpClamp, FLOAT); DEF_INSTANTIATE_RANK0_6_ONE_RANK_ONE_TYPE(OpClamp, INT8); DEF_INSTANTIATE_RANK0_6_ONE_RANK_ONE_TYPE(OpClamp, INT16); -DEF_INSTANTIATE_RANK0_6_ONE_RANK_ONE_TYPE(OpReluN, FLOAT); -DEF_INSTANTIATE_RANK0_6_ONE_RANK_ONE_TYPE(OpReluN, INT32); - DEF_INSTANTIATE_RANK0_6_ONE_RANK_ONE_TYPE(OpSigmoid, FLOAT); DEF_INSTANTIATE_RANK0_6_ONE_RANK_ONE_TYPE(OpTanh, FLOAT); diff --git a/reference_model/src/ops/activation_funcs.h b/reference_model/src/ops/activation_funcs.h index c834b52..10385e0 100644 --- a/reference_model/src/ops/activation_funcs.h +++ b/reference_model/src/ops/activation_funcs.h @@ -45,26 +45,6 @@ protected: }; template <int Rank, DType Dtype> -class OpReluN : public UnaryNode<Rank, Dtype> -{ -public: - OpReluN(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, TosaQuantInfoBase* qinfo_, uint64_t id_) - : UnaryNode<Rank, Dtype>(sgt_, Op_RELUN, id_) - { - INIT_ATTRIBUTE(ReluN); - register_fcn(); - } - static constexpr int32_t QMin = GetQMin<Dtype>::value; - static constexpr int32_t QMax = GetQMax<Dtype>::value; - using InEigenType = typename GetEigenType<Dtype>::type; - using OutEigenType = typename GetEigenType<Dtype>::type; - virtual int register_fcn(); - -protected: - TosaReluNAttribute* attribute; -}; - -template <int Rank, DType Dtype> class OpSigmoid : public UnaryNode<Rank, Dtype> { public: diff --git a/reference_model/src/ops/op_factory.cc b/reference_model/src/ops/op_factory.cc index 3bc55a8..a9ee136 100644 --- a/reference_model/src/ops/op_factory.cc +++ b/reference_model/src/ops/op_factory.cc @@ -105,10 +105,6 @@ GraphNode* OpFactory::newOp(SubgraphTraverser* sgt, DEF_FACTORY_RANK0_6_ONE_RANK_ONE_TYPE(OpClamp, INT8); DEF_FACTORY_RANK0_6_ONE_RANK_ONE_TYPE(OpClamp, INT16); break; - case Op_RELUN: - DEF_FACTORY_RANK0_6_ONE_RANK_ONE_TYPE(OpReluN, FLOAT); - DEF_FACTORY_RANK0_6_ONE_RANK_ONE_TYPE(OpReluN, INT32); - break; case Op_SIGMOID: DEF_FACTORY_RANK0_6_ONE_RANK_ONE_TYPE(OpSigmoid, FLOAT); break; |