TVM  0.9.4
tvm::graph::internal::AbstractNode Class Reference

#include <tvm/graph/internal/AbstractNode.h>

Inheritance diagram for tvm::graph::internal::AbstractNode:
Collaboration diagram for tvm::graph::internal::AbstractNode:

Classes

struct  Update
 

Public Types

enum class  Update_
 
using UpdateParent = AbstractNode
 
using UpdateBase = AbstractNode
 
- Public Types inherited from tvm::graph::internal::Inputs
using inputs_t = std::unordered_map< abstract::Outputs *, std::set< int > >
 
using store_t = std::unordered_set< std::shared_ptr< abstract::Outputs > >
 
- Public Types inherited from tvm::graph::abstract::Outputs
enum class  Output_
 
using OutputParent = Outputs
 
using OutputBase = Outputs
 

Public Member Functions

template<typename EnumT >
bool isUpdateEnabled (EnumT e) const
 
virtual bool isUpdateStaticallyEnabled (int) const
 
virtual bool isUpdateCustomEnabled (int) const
 
virtual ~AbstractNode ()=default
 
void update (int i)
 
- Public Member Functions inherited from tvm::graph::internal::Inputs
virtual ~Inputs ()=default
 
template<typename T , typename EnumI , typename... Args>
void addInput (std::shared_ptr< T > source, EnumI i, Args... args)
 
template<typename T , typename EnumI , typename... Args, typename std::enable_if< std::is_base_of< abstract::Outputs, T >::value, int >::type = 0>
void addInput (T &source, EnumI i, Args... args)
 
template<typename T >
void removeInput (T *source)
 
template<typename T , typename... Args>
void removeInput (T *source, Args... args)
 
template<typename T >
Iterator getInput (T *source)
 
template<typename T >
Iterator getInput (const std::shared_ptr< T > &source)
 
- Public Member Functions inherited from tvm::graph::abstract::Outputs
virtual ~Outputs ()=default
 
template<typename EnumT >
bool isOutputEnabled (EnumT e) const
 
bool isOutputEnabled (int i) const
 
virtual bool isOutputStaticallyEnabled (int) const
 
virtual bool isOutputCustomEnabled (int) const
 

Static Public Member Functions

static constexpr const char * UpdateName (Update_)
 
template<typename EnumT >
static constexpr bool UpdateStaticallyEnabled (EnumT)
 
- Static Public Member Functions inherited from tvm::graph::abstract::Outputs
static constexpr const char * OutputName (Output_)
 
template<typename EnumT >
static constexpr bool OutputStaticallyEnabled (EnumT)
 

Static Public Attributes

static constexpr unsigned int UpdateSize = 0
 
static constexpr auto UpdateBaseName = "AbstractNode"
 
- Static Public Attributes inherited from tvm::graph::abstract::Outputs
static constexpr unsigned int OutputSize = 0
 
static constexpr auto OutputBaseName = "Outputs"
 

Protected Types

using input_dependency_t = std::map< Outputs *, std::set< int > >
 

Protected Attributes

std::map< int, std::function< void(AbstractNode &)> > updates_
 
std::map< int, std::vector< int > > outputDependencies_
 
std::map< int, std::vector< int > > internalDependencies_
 
std::map< int, input_dependency_tinputDependencies_
 
std::map< int, std::pair< Outputs *, int > > directDependencies_
 
- Protected Attributes inherited from tvm::graph::abstract::Outputs
bool is_node_ = false
 

Friends

template<typename T >
class tvm::graph::abstract::Node
 
class tvm::graph::CallGraph
 

Detailed Description

An abstract node is the structure stored in the call graph to hide away the actual type of the node.

Member Typedef Documentation

◆ input_dependency_t

using tvm::graph::internal::AbstractNode::input_dependency_t = std::map<Outputs *, std::set<int> >
protected

Map from an update to the list of inputs it depends on (expressed by the respective ids).

◆ UpdateBase

Meta-information used during inheritance to retrieve the base-class output size

◆ UpdateParent

Meta-information regarding the class inheritance diagram

Member Enumeration Documentation

◆ Update_

Base Update enumeration. Empty

Constructor & Destructor Documentation

◆ ~AbstractNode()

virtual tvm::graph::internal::AbstractNode::~AbstractNode ( )
virtualdefault

Member Function Documentation

◆ isUpdateCustomEnabled()

virtual bool tvm::graph::internal::AbstractNode::isUpdateCustomEnabled ( int  ) const
inlinevirtual

Check if an update is enabled given a custom criterion

The default implementation always return true. This is a handle for the user to override.

◆ isUpdateEnabled()

template<typename EnumT >
bool tvm::graph::internal::AbstractNode::isUpdateEnabled ( EnumT  e) const
inline

Check if a given update is enabled, be it at the class (static) or instance (dynamic) level).

◆ isUpdateStaticallyEnabled()

virtual bool tvm::graph::internal::AbstractNode::isUpdateStaticallyEnabled ( int  ) const
inlinevirtual

Check if a given update is enabled at the class level (run-time).

The default implementation always returns true. The expected parameter is int to swallow the different update types.

◆ update()

void tvm::graph::internal::AbstractNode::update ( int  i)
inline

Call the function stored at index i

◆ UpdateName()

static constexpr const char* tvm::graph::internal::AbstractNode::UpdateName ( Update_  )
inlinestaticconstexpr

Return the name of a given update

◆ UpdateStaticallyEnabled()

template<typename EnumT >
static constexpr bool tvm::graph::internal::AbstractNode::UpdateStaticallyEnabled ( EnumT  )
inlinestaticconstexpr

Check if a given update is enabled (compile-time)

The default implementation always return true.

Friends And Related Function Documentation

◆ tvm::graph::abstract::Node

template<typename T >
friend class tvm::graph::abstract::Node
friend

◆ tvm::graph::CallGraph

friend class tvm::graph::CallGraph
friend

Member Data Documentation

◆ directDependencies_

std::map<int, std::pair<Outputs *, int> > tvm::graph::internal::AbstractNode::directDependencies_
protected

Map from an output to the input it directly uses, without requiring an update (expressed by the respective ids).

◆ inputDependencies_

std::map<int, input_dependency_t> tvm::graph::internal::AbstractNode::inputDependencies_
protected

◆ internalDependencies_

std::map<int, std::vector<int> > tvm::graph::internal::AbstractNode::internalDependencies_
protected

Map from an update to the list of updates it depends on (expressed by the respective ids).

◆ outputDependencies_

std::map<int, std::vector<int> > tvm::graph::internal::AbstractNode::outputDependencies_
protected

Map from an output to the list of updates it depends on (expressed by the respective ids).

◆ UpdateBaseName

constexpr auto tvm::graph::internal::AbstractNode::UpdateBaseName = "AbstractNode"
staticconstexpr

Meta-information holding the name of the class to which the Update enum belong

◆ updates_

std::map<int, std::function<void(AbstractNode &)> > tvm::graph::internal::AbstractNode::updates_
protected

Map from a update id to corresponding dependency function.

◆ UpdateSize

constexpr unsigned int tvm::graph::internal::AbstractNode::UpdateSize = 0
staticconstexpr

Store the size of the Update enumeration


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