mxnet
graph_attr_types.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
24 #ifndef NNVM_GRAPH_ATTR_TYPES_H_
25 #define NNVM_GRAPH_ATTR_TYPES_H_
26 
27 #include <vector>
28 #include <string>
29 #include <unordered_map>
30 #include "tuple.h"
31 #include "layout.h"
32 
33 namespace nnvm {
34 
45 using JSONString = std::string;
46 
60 using ShapeVector = std::vector<TShape>;
61 
75 using DTypeVector = std::vector<int>;
76 
90 using LayoutVector = std::vector<Layout>;
91 
103 using DeviceVector = std::vector<int>;
104 
111 using DeviceAssignMap = std::unordered_map<std::string, int>;
112 
127 using StorageVector = std::vector<int>;
128 
129 } // namespace nnvm
130 
131 #endif // NNVM_GRAPH_ATTR_TYPES_H_
Definition: base.h:35
std::vector< int > StorageVector
The result holder of storage id of each NodeEntry in the graph.
Definition: graph_attr_types.h:127
std::vector< int > DeviceVector
The result holder of device of each operator in the graph.
Definition: graph_attr_types.h:103
std::unordered_map< std::string, int > DeviceAssignMap
The result holder of device of each operator in the graph.
Definition: graph_attr_types.h:111
std::string JSONString
The result holder of JSON serializer.
Definition: graph_attr_types.h:45
Data structure Tuple and TShape to store dynamic sized shapes.
std::vector< TShape > ShapeVector
The result holder of shape of each NodeEntry in the graph.
Definition: graph_attr_types.h:60
std::vector< int > DTypeVector
The result holder of type of each NodeEntry in the graph.
Definition: graph_attr_types.h:75
Layout expression. The layout is composed of upper cases, lower cases and numbers, where upper case indicates a (super-)dimension and the corresponding lower case with factor size indicates the split (sub-)dimension. For example, NCHW16c can describe a 5-D tensor of [batch_size, channel, height, width, channel_block]. Here sub-dimension channel_block=16 is the split of super-dimension C (channel).
std::vector< Layout > LayoutVector
The result holder of layout of each NodeEntry in the graph.
Definition: graph_attr_types.h:90