27 #ifndef TVM_SCRIPT_PRINTER_CONFIG_H_
28 #define TVM_SCRIPT_PRINTER_CONFIG_H_
30 #include <tvm/ffi/any.h>
31 #include <tvm/ffi/container/array.h>
32 #include <tvm/ffi/container/map.h>
33 #include <tvm/ffi/dtype.h>
34 #include <tvm/ffi/reflection/access_path.h>
35 #include <tvm/ffi/reflection/registry.h>
36 #include <tvm/ffi/string.h>
89 ffi::Map<ffi::ObjectRef, ffi::String>
obj_to_annotate = ffi::Map<ffi::ObjectRef, ffi::String>();
109 template <
typename T>
113 return (*it).second.as_or_throw<T>();
117 namespace refl = tvm::ffi::reflection;
118 refl::ObjectDef<PrinterConfigNode>()
149 ffi::Map<ffi::String, ffi::Any> config_dict = ffi::Map<ffi::String, ffi::Any>());
DLDataType int_dtype
Default data type of integer literals.
Definition: config.h:59
ffi::String ir_prefix
The prefix of IR nodes.
Definition: config.h:50
static constexpr const bool _type_mutable
Definition: config.h:142
ffi::Array< ffi::String > binding_names
A stack that tracks the names of the binding hierarchy.
Definition: config.h:46
ffi::Array< ffi::ObjectRef > obj_to_underline
ffi::Object to be underlined.
Definition: config.h:87
bool print_line_numbers
Whether to print line numbers.
Definition: config.h:71
bool render_invisible_path_info
Whether to render access-path context for invisible underlined paths. Defaults true.
Definition: config.h:80
bool verbose_expr
Whether or not to verbose print expressions.
Definition: config.h:67
bool syntax_sugar
Whether to output with syntax sugar, set false for complete printing.
Definition: config.h:75
DLDataType float_dtype
Default data type of float literals. Right now we always print out the explicit type of floating poin...
Definition: config.h:65
ffi::Map< ffi::reflection::AccessPath, ffi::String > path_to_annotate
ffi::Object path to be annotated.
Definition: config.h:85
ffi::Map< ffi::ObjectRef, ffi::String > obj_to_annotate
ffi::Object to be annotated.
Definition: config.h:89
bool show_object_address
Whether variable names should include the object's address.
Definition: config.h:77
int indent_spaces
Number of spaces used for indentation.
Definition: config.h:69
int num_context_lines
Number of context lines to print around the underlined text.
Definition: config.h:73
ffi::Map< ffi::String, ffi::Any > extra_config
Generic extension map for dialect-specific config knobs.
Definition: config.h:101
bool show_meta
Whether or not to show metadata.
Definition: config.h:48
ffi::Array< ffi::reflection::AccessPath > path_to_underline
Definition: config.h:83
ffi::Array< ffi::String > GetBuiltinKeywords()
T GetExtraConfig(const ffi::String &key, T fallback) const
Look up a value in extra_config with type cast and fallback.
Definition: config.h:110
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("script.PrinterConfig", PrinterConfigNode, ffi::Object)
DLDataType buffer_dtype
Default buffer dtype.
Definition: config.h:57
ffi::String module_alias
The alias of the current module at cross-function call.
Definition: config.h:55
static void RegisterReflection()
Definition: config.h:116
PrinterConfig(ffi::Map< ffi::String, ffi::Any > config_dict=ffi::Map< ffi::String, ffi::Any >())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(PrinterConfig, ffi::ObjectRef, PrinterConfigNode)
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition: analyzer.h:40
std::string RedirectedReprPrinterMethod(const ffi::ObjectRef &obj)
The fallback body used by TVM_REGISTER_SCRIPT_AS_REPR (defined in printer.h).