tvm
Public Types | Public Member Functions | List of all members
tvm::NodeFunctor< R(const ObjectRef &n, Args...)> Class Template Reference

#include <functor.h>

Collaboration diagram for tvm::NodeFunctor< R(const ObjectRef &n, Args...)>:

Public Types

using result_type = R
 the result type of this functor More...
 

Public Member Functions

bool can_dispatch (const ObjectRef &n) const
 Whether the functor can dispatch the corresponding Node. More...
 
operator() (const ObjectRef &n, Args... args) const
 invoke the functor, dispatch on type of n More...
 
template<typename TNode >
TSelfset_dispatch (FPointer f)
 set the dispatcher for type TNode More...
 
template<typename TNode >
TSelfclear_dispatch ()
 unset the dispatcher for type TNode More...
 

Member Typedef Documentation

◆ result_type

template<typename R , typename... Args>
using tvm::NodeFunctor< R(const ObjectRef &n, Args...)>::result_type = R

the result type of this functor

Member Function Documentation

◆ can_dispatch()

template<typename R , typename... Args>
bool tvm::NodeFunctor< R(const ObjectRef &n, Args...)>::can_dispatch ( const ObjectRef n) const
inline

Whether the functor can dispatch the corresponding Node.

Parameters
nThe node to be dispatched
Returns
Whether dispatching function is registered for n's type.

◆ clear_dispatch()

template<typename R , typename... Args>
template<typename TNode >
TSelf& tvm::NodeFunctor< R(const ObjectRef &n, Args...)>::clear_dispatch ( )
inline

unset the dispatcher for type TNode

Template Parameters
TNodethe type of Node to be dispatched.
Returns
reference to self.

◆ operator()()

template<typename R , typename... Args>
R tvm::NodeFunctor< R(const ObjectRef &n, Args...)>::operator() ( const ObjectRef n,
Args...  args 
) const
inline

invoke the functor, dispatch on type of n

Parameters
nThe Node argument
argsThe additional arguments
Returns
The result.

◆ set_dispatch()

template<typename R , typename... Args>
template<typename TNode >
TSelf& tvm::NodeFunctor< R(const ObjectRef &n, Args...)>::set_dispatch ( FPointer  f)
inline

set the dispatcher for type TNode

Parameters
fThe function to be set.
Template Parameters
TNodethe type of Node to be dispatched.
Returns
reference to self.

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