tvm
Classes | Namespaces | Macros | Functions
config.h File Reference

Printer class to print repr string of each AST/IR nodes. More...

#include <tvm/ffi/any.h>
#include <tvm/ffi/container/array.h>
#include <tvm/ffi/container/map.h>
#include <tvm/ffi/reflection/access_path.h>
#include <tvm/ffi/reflection/registry.h>
#include <tvm/ffi/string.h>
#include <tvm/ir/cast.h>
#include <tvm/ir/node_functor.h>
#include <tvm/runtime/data_type.h>
#include <string>
Include dependency graph for config.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tvm::PrinterConfigNode
 
class  tvm::PrinterConfig
 
class  tvm::TVMScriptPrinter
 TVMScript-based printer for IR nodes. More...
 

Namespaces

 tvm
 An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
 

Macros

#define TVM_OBJECT_ENABLE_SCRIPT_PRINTER()
 
#define TVM_REGISTER_SCRIPT_AS_REPR(ObjectType, Method)
 Register Script as the kRepr callback for ObjectType and install the per-type dispatch entry in TVMScriptPrinter::vtable(). More...
 

Functions

std::string tvm::RedirectedReprPrinterMethod (const ffi::ObjectRef &obj)
 The fallback body used by TVM_REGISTER_SCRIPT_AS_REPR. More...
 

Detailed Description

Printer class to print repr string of each AST/IR nodes.

Macro Definition Documentation

◆ TVM_OBJECT_ENABLE_SCRIPT_PRINTER

#define TVM_OBJECT_ENABLE_SCRIPT_PRINTER ( )
Value:
std::string Script(const ffi::Optional<PrinterConfig>& config = std::nullopt) const { \
return TVMScriptPrinter::Script(ffi::GetRef<ffi::ObjectRef>(this), \
config.value_or(PrinterConfig())); \
}

◆ TVM_REGISTER_SCRIPT_AS_REPR

#define TVM_REGISTER_SCRIPT_AS_REPR (   ObjectType,
  Method 
)
Value:
TVM_FFI_STATIC_INIT_BLOCK() { \
namespace refl = tvm::ffi::reflection; \
refl::TypeAttrDef<ObjectType>().def(refl::type_attr::kRepr, \
[](ffi::ObjectRef obj, ffi::Function) -> ffi::String { \
}); \
} \
TVM_STATIC_IR_FUNCTOR(TVMScriptPrinter, vtable).set_dispatch<ObjectType>(Method)
tvm::relax::Function Function
Definition: transform.h:38
std::string RedirectedReprPrinterMethod(const ffi::ObjectRef &obj)
The fallback body used by TVM_REGISTER_SCRIPT_AS_REPR.

Register Script as the kRepr callback for ObjectType and install the per-type dispatch entry in TVMScriptPrinter::vtable().

Parameters
ObjectTypeThe concrete object node type (e.g. tirx::VarNode).
MethodThe TVMScriptPrinter vtable dispatch function.