Caffe2 - C++ API
A deep learning, cross platform ML framework
Type.h
1 #ifndef C10_UTIL_TYPE_H_
2 #define C10_UTIL_TYPE_H_
3 
4 #include <cstddef>
5 #include <string>
6 #include <typeinfo>
7 
8 #include "c10/macros/Macros.h"
9 
10 namespace c10 {
11 
13 C10_API std::string demangle(const char* name);
14 
16 template <typename T>
17 inline const char* demangle_type() {
18 #ifdef __GXX_RTTI
19  static const auto& name = *(new std::string(demangle(typeid(T).name())));
20  return name.c_str();
21 #else // __GXX_RTTI
22  return "(RTTI disabled, cannot show name)";
23 #endif // __GXX_RTTI
24 }
25 
26 } // namespace c10
27 
28 #endif // C10_UTIL_TYPE_H_
To register your own kernel for an operator, do in one (!) cpp file: C10_REGISTER_KERNEL(OperatorHand...
Definition: alias_info.h:7
std::string demangle(const char *name)
Utility to demangle a C++ symbol name.
Definition: Type.cpp:23
const char * demangle_type()
Returns the printable name of the type.
Definition: Type.h:17