variable.hpp
1 //*****************************************************************************
2 // Copyright 2020 Intel Corporation
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 #pragma once
18 
19 #include <utility>
20 
21 #include "ngraph/op/op.hpp"
22 
23 namespace ngraph
24 {
25  struct VariableInfo
26  {
27  PartialShape data_shape;
28  element::Type data_type;
29  std::string variable_id;
30  };
31 
32  class NGRAPH_API Variable
33  {
34  public:
35  Variable() = default;
36 
37  explicit Variable(const VariableInfo& variable_info)
38  : m_info(variable_info)
39  {
40  }
41 
42  VariableInfo get_info() { return m_info; }
43  void update(const VariableInfo& variable_info) { m_info = variable_info; }
44  private:
45  VariableInfo m_info;
46  };
47 }
ngraph::PartialShape
Class representing a shape that may be partially or totally dynamic.
Definition: partial_shape.hpp:46
ngraph
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28
ngraph::VariableInfo
Definition: variable.hpp:26
ngraph::Variable
Definition: variable.hpp:33