1 /** 2 * Copyright 2021 Huawei Technologies Co., Ltd 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef MINDSPORE_LITE_MICRO_CODER_OPCODERS_SERIALIZERS_NNACL_FP32_SERIALIZER_H_ 18 #define MINDSPORE_LITE_MICRO_CODER_OPCODERS_SERIALIZERS_NNACL_FP32_SERIALIZER_H_ 19 #include <string> 20 #include <sstream> 21 #include "coder/opcoders/serializers/serializer.h" 22 #include "nnacl/batchnorm_parameter.h" 23 #include "nnacl/fp32/arithmetic_fp32.h" 24 #include "nnacl/conv_parameter.h" 25 #include "nnacl/matmul_parameter.h" 26 #include "nnacl/scale.h" 27 #include "nnacl/slice_parameter.h" 28 #include "nnacl/base/tile_base.h" 29 #include "nnacl/fp32/transpose_fp32.h" 30 #include "nnacl/pooling_parameter.h" 31 #include "nnacl/softmax_parameter.h" 32 #include "nnacl/splice_parameter.h" 33 #include "nnacl/lstm_parameter.h" 34 #include "wrapper/fp32/dequant_int8_to_fp32_wrapper.h" 35 #include "nnacl/fp32/exp_fp32.h" 36 #include "nnacl/fp32/strided_slice_fp32.h" 37 #include "wrapper/fp32/arithmetic_fp32_wrapper.h" 38 39 namespace mindspore::lite::micro::nnacl { 40 41 class NNaclFp32Serializer : public Serializer { 42 public: 43 NNaclFp32Serializer() = default; 44 ~NNaclFp32Serializer() override = default; 45 void CodeStruct(const std::string &name, const PoolingParameter &pooling_parameter); 46 void CodeStruct(const std::string &name, const SoftmaxParameter &softmax_parameter); 47 void CodeStruct(const std::string &name, const BatchNormParameter &batch_norm_parameter); 48 void CodeStruct(const std::string &name, const ArithmeticParameter &arithmetic_parameter); 49 void CodeStruct(const std::string &name, const ConvParameter &conv_parameter); 50 void CodeStruct(const std::string &name, const MatMulParameter &mat_mul_parameter); 51 void CodeStruct(const std::string &name, const LstmParameter &lstm_parameter); 52 void CodeStruct(const std::string &name, const ScaleParameter &scale_parameter); 53 void CodeStruct(const std::string &name, const SliceParameter &slice_parameter); 54 void CodeStruct(const std::string &name, const TileParameter &tile_parameter); 55 void CodeStruct(const std::string &name, const TransposeParameter &transpose_parameter); 56 void CodeStruct(const std::string &name, const DeQuantArg &de_quant_arg); 57 void CodeStruct(const std::string &name, const SpliceParameter &splice_parameter); 58 void CodeStruct(const std::string &name, const ExpParameter &exp_parameter); 59 void CodeStruct(const std::string &name, const StridedSliceParameter &strided_slice_parameter); 60 void CodeStruct(const std::string &name, const ArithmeticWrapperInfo &arithmetic_wrapper_info); 61 }; 62 63 } // namespace mindspore::lite::micro::nnacl 64 #endif // MINDSPORE_LITE_MICRO_CODER_OPCODERS_SERIALIZERS_NNACL_FP32_ERIALIZER_H_ 65