tvm
Public Types | Public Member Functions | List of all members
tvm::TracedObject< RefT > Class Template Reference

Traced wrapper for regular (non-container) TVM objects. More...

#include <traced_object.h>

Collaboration diagram for tvm::TracedObject< RefT >:

Public Types

using ObjectRefType = RefT
 

Public Member Functions

 TracedObject (const RefT &object_ref, ObjectPath path)
 
template<typename DerivedRef >
 TracedObject (const TracedObject< DerivedRef > &derived)
 
template<typename T , typename BaseType >
detail::TracedObjectWrapperSelector< T >::Type GetAttr (T BaseType::*member_ptr) const
 Get a traced wrapper for an attribute of the wrapped object. More...
 
const RefT & Get () const
 Access the wrapped object. More...
 
template<typename RefU >
bool IsInstance () const
 Check if the reference to the wrapped object can be converted to RefU. More...
 
bool defined () const
 Same as Get().defined(). More...
 
template<typename RefU >
TracedObject< RefU > Downcast () const
 Convert the wrapped reference type to a subtype. More...
 
template<typename RefU >
TracedOptional< RefU > TryDowncast () const
 Convert the wrapped reference type to a subtype. More...
 
const ObjectPathGetPath () const
 Get the path of the wrapped object. More...
 

Detailed Description

template<typename RefT>
class tvm::TracedObject< RefT >

Traced wrapper for regular (non-container) TVM objects.

Member Typedef Documentation

◆ ObjectRefType

template<typename RefT>
using tvm::TracedObject< RefT >::ObjectRefType = RefT

Constructor & Destructor Documentation

◆ TracedObject() [1/2]

template<typename RefT>
tvm::TracedObject< RefT >::TracedObject ( const RefT &  object_ref,
ObjectPath  path 
)
inlineexplicit

◆ TracedObject() [2/2]

template<typename RefT>
template<typename DerivedRef >
tvm::TracedObject< RefT >::TracedObject ( const TracedObject< DerivedRef > &  derived)
inline

Member Function Documentation

◆ defined()

template<typename RefT>
bool tvm::TracedObject< RefT >::defined ( ) const
inline

Same as Get().defined().

◆ Downcast()

template<typename RefT>
template<typename RefU >
TracedObject<RefU> tvm::TracedObject< RefT >::Downcast ( ) const
inline

Convert the wrapped reference type to a subtype.

Throws an exception if IsInstance<RefU>() is false.

◆ Get()

template<typename RefT>
const RefT& tvm::TracedObject< RefT >::Get ( ) const
inline

Access the wrapped object.

◆ GetAttr()

template<typename RefT>
template<typename T , typename BaseType >
detail::TracedObjectWrapperSelector<T>::Type tvm::TracedObject< RefT >::GetAttr ( T BaseType::*  member_ptr) const
inline

Get a traced wrapper for an attribute of the wrapped object.

◆ GetPath()

template<typename RefT>
const ObjectPath& tvm::TracedObject< RefT >::GetPath ( ) const
inline

Get the path of the wrapped object.

◆ IsInstance()

template<typename RefT>
template<typename RefU >
bool tvm::TracedObject< RefT >::IsInstance ( ) const
inline

Check if the reference to the wrapped object can be converted to RefU.

◆ TryDowncast()

template<typename RefT>
template<typename RefU >
TracedOptional<RefU> tvm::TracedObject< RefT >::TryDowncast ( ) const
inline

Convert the wrapped reference type to a subtype.

Returns an empty optional if IsInstance<RefU>() is false.


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