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 
25 #ifndef NNVM_GRAPH_ATTR_TYPES_H_
26 #define NNVM_GRAPH_ATTR_TYPES_H_
27 
28 #include <vector>
29 #include <string>
30 #include <unordered_map>
31 #include "tuple.h"
32 #include "layout.h"
33 
34 namespace nnvm {
35 
46 using JSONString = std::string;
47 
61 using ShapeVector = std::vector<TShape>;
62 
76 using DTypeVector = std::vector<int>;
77 
91 using LayoutVector = std::vector<Layout>;
92 
104 using DeviceVector = std::vector<int>;
105 
112 using DeviceAssignMap = std::unordered_map<std::string, int>;
113 
128 using StorageVector = std::vector<int>;
129 
130 } // namespace nnvm
131 
132 #endif // NNVM_GRAPH_ATTR_TYPES_H_
Definition: base.h:36
std::vector< int > StorageVector
The result holder of storage id of each NodeEntry in the graph.
Definition: graph_attr_types.h:128
std::vector< int > DeviceVector
The result holder of device of each operator in the graph.
Definition: graph_attr_types.h:104
std::unordered_map< std::string, int > DeviceAssignMap
The result holder of device of each operator in the graph.
Definition: graph_attr_types.h:112
std::string JSONString
The result holder of JSON serializer.
Definition: graph_attr_types.h:46
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:61
std::vector< int > DTypeVector
The result holder of type of each NodeEntry in the graph.
Definition: graph_attr_types.h:76
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:91