Caffe2 - C++ API
A deep learning, cross platform ML framework
Static Public Member Functions | Friends
caffe2::TypeIdentifier Class Referencefinal

A type id is a unique id for a given C++ type. More...

#include <typeid.h>

Inheritance diagram for caffe2::TypeIdentifier:
c10::IdWrapper< TypeIdentifier, uint16_t >

Static Public Member Functions

static TypeIdentifier createTypeId ()
static constexpr TypeIdentifier uninitialized ()
template<typename T >
static C10_API TypeIdentifier Get ()
 Returns the unique id for the given type T. More...


class TypeMeta
std::ostream & operator<< (std::ostream &stream, TypeIdentifier typeId)
bool operator< (TypeIdentifier lhs, TypeIdentifier rhs)

Additional Inherited Members

- Public Types inherited from c10::IdWrapper< TypeIdentifier, uint16_t >
using underlying_type = uint16_t
using concrete_type = TypeIdentifier
- Protected Member Functions inherited from c10::IdWrapper< TypeIdentifier, uint16_t >
constexpr IdWrapper (underlying_type id) noexcept(noexcept(underlying_type(std::declval< underlying_type >())))
constexpr underlying_type underlyingId () const noexcept(noexcept(underlying_type(std::declval< underlying_type >())))

Detailed Description

A type id is a unique id for a given C++ type.

You need to register your types using CAFFE_KNOWN_TYPE(MyType) to be able to use TypeIdentifier with custom types. This is for example used to store the dtype of tensors.

Definition at line 60 of file typeid.h.

Member Function Documentation

template<typename T >
static C10_API TypeIdentifier caffe2::TypeIdentifier::Get ( )

Returns the unique id for the given type T.

The id is unique for the type T in the sense that for any two different types, their ids are different; for the same type T, the id remains the same over different calls of the function. However, this is not guaranteed over different runs, as the id is generated during run-time. Do NOT serialize the id for storage.

The documentation for this class was generated from the following files: