• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2022 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_CORE_OPS_FSE_DECODER_H_
18 #define MINDSPORE_CORE_OPS_FSE_DECODER_H_
19 
20 #include <algorithm>
21 #include <map>
22 #include <memory>
23 #include <string>
24 #include <vector>
25 
26 #include "mindapi/base/types.h"
27 #include "ops/base_operator.h"
28 
29 namespace mindspore {
30 namespace ops {
31 constexpr auto kNameFSEDecode = "FSEDecode";
32 /// \brief FSEDecode FSEDecode the FSEDecode operator prototype.
33 class MIND_API FSEDecode : public BaseOperator {
34  public:
35   MIND_API_BASE_MEMBER(FSEDecode);
36   /// \brief Constructor.
FSEDecode()37   FSEDecode() : BaseOperator(kNameFSEDecode) {}
38 
39   /// \brief Method to init the op's attributes.
40   ///
41   /// \param[in] dst_t Define the data type of output.
42   void Init(const int64_t dst_t, const int64_t curr_chunk, const int64_t curr_chunk_index, const int64_t curr_bit_count,
43             const int64_t table_log);
44 
45   /// \brief Method to set dst_t attribute.
46   ///
47   /// \param[in] dst_t Define the data type of output.
48   void set_dst_t(const int64_t dst_t);
49 
50   /// \brief Method to get dst_t attribute.
51   ///
52   /// \return the data type of output.
53   int64_t get_dst_t() const;
54 
55   /// \brief Method to set curr_chunk attribute.
56   ///
57   /// \param[in] curr_chunk Define the curr_chunk attribute.
58   void set_curr_chunk(const int64_t curr_chunk);
59 
60   /// \brief Method to get curr_chunk attribute.
61   ///
62   /// \return the curr_chunk attribute.
63   int64_t get_curr_chunk() const;
64 
65   /// \brief Method to set curr_chunk_index attribute.
66   ///
67   /// \param[in] curr_chunk_index Define the curr_chunk_index attribute.
68   void set_curr_chunk_index(const int64_t curr_chunk_index);
69 
70   /// \brief Method to get curr_chunk_index attribute.
71   ///
72   /// \return the curr_chunk_index attribute.
73   int64_t get_curr_chunk_index() const;
74 
75   /// \brief Method to set curr_bit_count attribute.
76   ///
77   /// \param[in] curr_bit_count Define the curr_bit_count attribute..
78   void set_curr_bit_count(const int64_t curr_bit_count);
79 
80   /// \brief Method to get curr_bit_count attribute.
81   ///
82   /// \return the curr_bit_count attribute.
83   int64_t get_curr_bit_count() const;
84 
85   /// \brief Method to set table_log attribute.
86   ///
87   /// \param[in] table_log Define the table_log attribute.
88   void set_table_log(const int64_t table_log);
89 
90   /// \brief Method to get table_log attribute.
91   ///
92   /// \return the table_log attribute.
93   int64_t get_table_log() const;
94 };
95 abstract::AbstractBasePtr FSEDecodeInfer(const abstract::AnalysisEnginePtr &, const PrimitivePtr &primitive,
96                                          const std::vector<abstract::AbstractBasePtr> &input_args);
97 }  // namespace ops
98 }  // namespace mindspore
99 
100 #endif  // MINDSPORE_CORE_OPS_FSE_DECODER_H_
101