23 #ifndef TVM_NODE_SCRIPT_PRINTER_H_
24 #define TVM_NODE_SCRIPT_PRINTER_H_
145 static constexpr
const char*
_type_key =
"node.PrinterConfig";
167 #define TVM_OBJECT_ENABLE_SCRIPT_PRINTER() \
168 std::string Script(const Optional<PrinterConfig>& config = NullOpt) const { \
169 return TVMScriptPrinter::Script(GetRef<ObjectRef>(this), config.value_or(PrinterConfig())); \
Visitor class to get the attributes of an AST/IR node. The content is going to be called for each fie...
Definition: reflection.h:52
A dynamically dispatched functor on the type of the first argument.
Definition: functor.h:64
Definition: script_printer.h:36
static constexpr const char * _type_key
Definition: script_printer.h:145
std::string tir_prefix
The prefix of TIR nodes.
Definition: script_printer.h:45
bool print_line_numbers
Whether to print line numbers.
Definition: script_printer.h:68
Array< String > GetBuiltinKeywords()
DataType int_dtype
Default data type of integer literals.
Definition: script_printer.h:56
bool verbose_expr
Whether or not to verbose print expressions.
Definition: script_printer.h:64
bool syntax_sugar
Whether to output with syntax sugar, set false for complete printing.
Definition: script_printer.h:72
Array< ObjectRef > obj_to_underline
Object to be underlined.
Definition: script_printer.h:116
bool show_all_struct_info
In Relax, whether to show all StructInfo annotations.
Definition: script_printer.h:109
bool show_object_address
Whether variable names should include the object's address.
Definition: script_printer.h:74
int indent_spaces
Number of spaces used for indentation.
Definition: script_printer.h:66
int num_context_lines
Number of context lines to print around the underlined text.
Definition: script_printer.h:70
bool show_meta
Whether or not to show metadata.
Definition: script_printer.h:41
std::string relax_prefix
The prefix of Relax nodes.
Definition: script_printer.h:47
Map< ObjectRef, String > obj_to_annotate
Object to be annotated.
Definition: script_printer.h:118
Array< String > binding_names
A stack that tracks the names of the binding hierarchy.
Definition: script_printer.h:39
DataType float_dtype
Default data type of float literals. Right now we always print out the explicit type of floating poin...
Definition: script_printer.h:62
std::string module_alias
The alias of the current module at cross-function call.
Definition: script_printer.h:52
DataType buffer_dtype
Default data type of TIR buffer.
Definition: script_printer.h:54
TVM_DECLARE_FINAL_OBJECT_INFO(PrinterConfigNode, Object)
Map< ObjectPath, String > path_to_annotate
Object path to be annotated.
Definition: script_printer.h:114
void VisitAttrs(AttrVisitor *v)
Definition: script_printer.h:120
Array< ObjectPath > path_to_underline
Definition: script_printer.h:112
std::string ir_prefix
The prefix of IR nodes.
Definition: script_printer.h:43
Definition: script_printer.h:149
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(PrinterConfig, runtime::ObjectRef, PrinterConfigNode)
PrinterConfig(Map< String, ObjectRef > config_dict=Map< String, ObjectRef >())
Legacy behavior of ReprPrinter.
Definition: script_printer.h:158
static std::string Script(const ObjectRef &node, const Optional< PrinterConfig > &cfg)
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Runtime primitive data type.
Definition: data_type.h:43
static DataType Float(int bits, int lanes=1)
Construct an float type.
Definition: data_type.h:236
static DataType Int(int bits, int lanes=1)
Construct an int type.
Definition: data_type.h:219
static DataType Void()
Construct a Void type.
Definition: data_type.h:276
Map container of NodeRef->NodeRef in DSL graph. Map implements copy on write semantics,...
Definition: map.h:1271
Base class of all object reference.
Definition: object.h:519
base class of all object containers.
Definition: object.h:171
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
Defines the Functor data structures.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
Reflection and serialization of compiler IR/AST nodes.