mxnet
base.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_BASE_H_
25 #define NNVM_BASE_H_
26 
27 #include <dmlc/base.h>
28 #include <dmlc/common.h>
29 #include <dmlc/any.h>
30 #include <dmlc/memory.h>
31 #include <dmlc/logging.h>
32 #include <dmlc/registry.h>
33 #include <dmlc/array_view.h>
34 
35 namespace nnvm {
36 
38 using dmlc::any;
39 
41 using dmlc::array_view;
42 
44 using dmlc::get;
45 
47 using dmlc::unsafe_get;
48 
49 enum TypeFlag {
50  kFloat32 = 0,
51  kFloat64 = 1,
52  kFloat16 = 2,
53  kUint8 = 3,
54  kInt32 = 4,
55  kInt8 = 5,
56  kInt64 = 6,
57  // kBool = 7,
58  // 7 is reserved for kBool, in order to keep consistency with MXNet TypeFlag defined in
59  // https://github.com/apache/incubator-mxnet/blob/master/3rdparty/mshadow/mshadow/base.h#L314
60  kInt16 = 8,
61  kUint16 = 9,
62  kUint32 = 10,
63  kUint64 = 11,
64  kBfloat16 = 12,
65 };
66 
67 } // namespace nnvm
68 
69 // describe op registration point
70 #define NNVM_STRINGIZE_DETAIL(x) #x
71 #define NNVM_STRINGIZE(x) NNVM_STRINGIZE_DETAIL(x)
72 #define NNVM_DESCRIBE(...) describe(__VA_ARGS__ "\n\nFrom:" __FILE__ ":" NNVM_STRINGIZE(__LINE__))
73 #define NNVM_ADD_FILELINE "\n\nDefined in " __FILE__ ":L" NNVM_STRINGIZE(__LINE__)
74 #endif // NNVM_BASE_H_
Read only data structure to reference continuous memory region of array. Provide unified view for vec...
Definition: array_view.h:36
Definition: base.h:64
Definition: base.h:35
Definition: base.h:54
Read only data structure to reference array.
Definition: base.h:53
Definition: base.h:60
Definition: base.h:61
Definition: base.h:63
Definition: base.h:51
Container to hold any data type.
Definition: base.h:62
Definition: base.h:50
Definition: base.h:55
TypeFlag
Definition: base.h:49
defines some common utility function.
Definition: base.h:56
Definition: base.h:52