TVM
0.9.2
|
#include <tvm/graph/abstract/OutputSelector.h>
Public Member Functions | |
template<typename... Args> | |
OutputSelector (Args &&... args) | |
void | lock () |
void | unlock () |
bool | isLocked () const |
Protected Member Functions | |
template<typename EnumT > | |
void | disableOutput (EnumT e) |
template<typename EnumT , typename... Args> | |
void | disableOutput (EnumT e, Args... args) |
template<typename EnumT > | |
void | enableOutput (EnumT e) |
template<typename EnumT , typename... Args> | |
void | enableOutput (EnumT e, Args... args) |
bool | isOutputCustomEnabled (int e) const override |
This class adds to its template argument the capability to enable or disable some of its outputs.
We use here a bit of template meta-programming to take care of the following problem: imagine we have the following inheritance structure class A class B : public OutputSelector class C : public B class D : public OutputSelector<C> We want D to hold a single vector of bool for tracking enabled outputs and a single bool for lock. In our example, this means that OutputSelector holds the data, and OutputSelector<C> reuse the same data. We implement this by checking if the template parameter is a derived class of OutputSelector. If it is not (case of A in our example) we make OutputSelector inherit from SelectorMembers<true> so that it inherits the data. If it is (case of C), we make OutputSelector inherit from SelectorMembers<false> so that no data is added.
|
inline |
Constructor. Simply forward the arguments for constructing OutputProvider
|
inlineprotected |
Disable an output. The enum must refer to an existing output.
|
inlineprotected |
Multi-argument version of disableOutput.
|
inlineprotected |
Enable an output. The enum must refer to an existing output.
|
inlineprotected |
Multi-argument version of enableOutput.
|
inline |
Check if the outputs are locked.
|
inlineoverrideprotected |
Override the method of Outputs to get the desired enable/disable behavior.
|
inline |
Lock the outputs, preventing them to be enabled or disabled.
|
inline |
Unlock the outputs, allowing them to be enabled or disabled.