• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_CORE_OPS_TENSOR_ARRAY_H_
18 #define MINDSPORE_CORE_OPS_TENSOR_ARRAY_H_
19 #include <string>
20 #include <vector>
21 #include "ops/base_operator.h"
22 
23 namespace mindspore {
24 namespace ops {
25 constexpr auto kNameTensorArray = "TensorArray";
26 
27 /// \brief Assert defined TensorArray operator prototype of lite.
28 class MIND_API TensorArray : public BaseOperator {
29  public:
30   MIND_API_BASE_MEMBER(TensorArray);
31   /// \brief Constructor.
TensorArray()32   TensorArray() : BaseOperator(kNameTensorArray) { InitIOName({"size"}, {"handle", "flow"}); }
33   /// \brief Method to init the op's attributes.
34   void Init(bool dynamic_size, bool identical_element_shapes, const std::vector<int> &element_shape, int data_type);
35   /// \brief Method to set dynamic_size attributes.
36   ///
37   /// \param[in] dynamic_size Define the dynamic_size.
38   void set_dynamic_size(bool dynamic_size);
39   /// \brief Method to set identical_element_shapes attributes.
40   ///
41   /// \param[in] identical_element_shapes Define the identical element shapes
42   void set_identical_element_shapes(bool identical_element_shapes);
43   /// \brief Method to set element_shape attributes.
44   ///
45   /// \param[in] element_shape Define the element shape.
46   void set_element_shape(const std::vector<int> &element_shape);
47   /// \brief Method to set data_type attributes.
48   ///
49   /// \param[in] data_type Define the data type.
50   void set_data_type(int data_type);
51   /// \brief Method to get dynamic_size attributes.
52   bool get_dynamic_size() const;
53   /// \brief Method to get element_shapes attributes.
54   bool get_identical_element_shapes() const;
55   /// \brief Method to get element_shape attributes.
56   const std::vector<int> get_element_shape() const;
57   /// \brief Method to get data_type attributes.
58   int get_data_type() const;
59 };
60 }  // namespace ops
61 }  // namespace mindspore
62 
63 #endif  // MINDSPORE_CORE_OPS_TENSOR_ARRAY_H_
64