28 #ifndef TVM_SCRIPT_PRINTER_PRINTER_H_
29 #define TVM_SCRIPT_PRINTER_PRINTER_H_
40 TVM_DLL std::string
Script(
const ffi::ObjectRef& node,
41 const ffi::Optional<PrinterConfig>& config = std::nullopt);
60 #define TVM_REGISTER_SCRIPT_AS_REPR(ObjectType, Method) \
61 TVM_FFI_STATIC_INIT_BLOCK() { \
62 namespace refl = tvm::ffi::reflection; \
63 refl::TypeAttrDef<ObjectType>().def(refl::type_attr::kRepr, \
64 [](ffi::ObjectRef obj, ffi::Function) -> ffi::String { \
65 return RedirectedReprPrinterMethod(obj); \
68 TVM_STATIC_IR_FUNCTOR(TVMScriptPrinter, vtable).set_dispatch<ObjectType>(Method)
A dynamically dispatched functor on the type of the first argument.
Definition: node_functor.h:62
Dispatch vtable used by per-dialect printers to register their object-type printing functions....
Definition: printer.h:47
Configuration object for the TVMScript printer.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition: analyzer.h:40
std::string Script(const ffi::ObjectRef &node, const ffi::Optional< PrinterConfig > &config=std::nullopt)
Print node as TVMScript with the given config.
Defines the Functor data structures.