23 #ifndef TVM_NODE_SCRIPT_PRINTER_H_ 24 #define TVM_NODE_SCRIPT_PRINTER_H_ 76 v->Visit(
"binding_names", &binding_names);
77 v->Visit(
"show_meta", &show_meta);
78 v->Visit(
"ir_prefix", &ir_prefix);
79 v->Visit(
"buffer_dtype", &buffer_dtype);
80 v->Visit(
"int_dtype", &int_dtype);
81 v->Visit(
"float_dtype", &float_dtype);
82 v->Visit(
"verbose_expr", &verbose_expr);
83 v->Visit(
"indent_spaces", &indent_spaces);
84 v->Visit(
"print_line_numbers", &print_line_numbers);
85 v->Visit(
"num_context_lines", &num_context_lines);
86 v->Visit(
"syntax_sugar", &syntax_sugar);
87 v->Visit(
"path_to_underline", &path_to_underline);
88 v->Visit(
"path_to_annotate", &path_to_annotate);
89 v->Visit(
"obj_to_underline", &obj_to_underline);
90 v->Visit(
"obj_to_annotate", &obj_to_annotate);
93 static constexpr
const char*
_type_key =
"node.PrinterConfig";
112 TVM_DLL
static FType& vtable();
115 #define TVM_OBJECT_ENABLE_SCRIPT_PRINTER() \ 116 std::string Script(const Optional<PrinterConfig>& config = NullOpt) const { \ 117 return TVMScriptPrinter::Script(GetRef<ObjectRef>(this), config.value_or(PrinterConfig())); \ 121 #endif // TVM_NODE_SCRIPT_PRINTER_H_ A dynamically dispatched functor on the type of the first argument.
Definition: functor.h:64
int num_context_lines
Number of context lines to print around the underlined text.
Definition: script_printer.h:63
#define TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:758
std::string tir_prefix
The prefix of TIR nodes.
Definition: script_printer.h:45
Definition: script_printer.h:36
int indent_spaces
Number of spaces used for indentation.
Definition: script_printer.h:59
static DataType Void()
Construct a Void type.
Definition: data_type.h:203
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
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:55
DataType int_dtype
Default data type of integer literals.
Definition: script_printer.h:49
Map< ObjectPath, String > path_to_annotate
Object path to be annotated.
Definition: script_printer.h:69
base class of all object containers.
Definition: object.h:167
bool print_line_numbers
Whether to print line numbers.
Definition: script_printer.h:61
Array< ObjectPath > path_to_underline
Definition: script_printer.h:67
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
Map< ObjectRef, String > obj_to_annotate
Object to be annotated.
Definition: script_printer.h:73
static constexpr const char * _type_key
Definition: script_printer.h:93
bool verbose_expr
Whether or not to verbose print expressions.
Definition: script_printer.h:57
Runtime primitive data type.
Definition: data_type.h:41
static DataType Float(int bits, int lanes=1)
Construct an float type.
Definition: data_type.h:178
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
TVM_DECLARE_FINAL_OBJECT_INFO(PrinterConfigNode, Object)
Legacy behavior of ReprPrinter.
Definition: script_printer.h:106
bool syntax_sugar
Whether to output with syntax sugar, set false for complete printing.
Definition: script_printer.h:65
bool show_meta
Whether or not to show metadata.
Definition: script_printer.h:41
void VisitAttrs(AttrVisitor *v)
Definition: script_printer.h:75
Defines the Functor data structures.
Base class of all object reference.
Definition: object.h:511
Array< String > binding_names
A stack that tracks the names of the binding hierarchy.
Definition: script_printer.h:39
Array< ObjectRef > obj_to_underline
Object to be underlined.
Definition: script_printer.h:71
Map container of NodeRef->NodeRef in DSL graph. Map implements copy on write semantics, which means map is mutable but copy will happen when array is referenced in more than two places.
Definition: map.h:1271
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
Reflection and serialization of compiler IR/AST nodes.
Definition: script_printer.h:97
static DataType Int(int bits, int lanes=1)
Construct an int type.
Definition: data_type.h:164
std::string ir_prefix
The prefix of IR nodes.
Definition: script_printer.h:43
DataType buffer_dtype
Default data type of TIR buffer.
Definition: script_printer.h:47