tvm
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
tvm::PrinterConfigNode Class Reference

#include <config.h>

Inheritance diagram for tvm::PrinterConfigNode:
Collaboration diagram for tvm::PrinterConfigNode:

Public Member Functions

template<typename T >
GetExtraConfig (const ffi::String &key, T fallback) const
 Look up a value in extra_config with type cast and fallback. More...
 
ffi::Array< ffi::String > GetBuiltinKeywords ()
 
 TVM_FFI_DECLARE_OBJECT_INFO_FINAL ("script.PrinterConfig", PrinterConfigNode, ffi::Object)
 

Static Public Member Functions

static void RegisterReflection ()
 

Public Attributes

ffi::Array< ffi::String > binding_names = {}
 A stack that tracks the names of the binding hierarchy. More...
 
bool show_meta = false
 Whether or not to show metadata. More...
 
ffi::String ir_prefix = "I"
 The prefix of IR nodes. More...
 
ffi::String tir_prefix = "T"
 The prefix of TIR nodes. More...
 
ffi::String tir_import_module = "tir"
 The TIR module name used in the printed import (e.g. "tir" or "tirx"). Used in the header comment: "from tvm.script import <tir_import_module> as <tir_prefix>". When tir_prefix is "Tx", set to "tirx" so the printed script uses "import tirx as Tx". More...
 
ffi::String tirx_prefix = "Tx"
 The prefix of TIRX nodes. More...
 
DataType buffer_dtype = DataType::Float(32)
 Default buffer dtype. More...
 
ffi::String relax_prefix = "R"
 The prefix of Relax nodes. More...
 
ffi::String module_alias = "cls"
 The alias of the current module at cross-function call. More...
 
DataType int_dtype = DataType::Int(32)
 Default data type of integer literals. More...
 
DataType float_dtype = DataType::Void()
 Default data type of float literals. Right now we always print out the explicit type of floating point values, so setting it to Void means we do not print without the T.float32/T.float64 wrapper. More...
 
bool verbose_expr = false
 Whether or not to verbose print expressions. More...
 
int indent_spaces = 4
 Number of spaces used for indentation. More...
 
bool print_line_numbers = false
 Whether to print line numbers. More...
 
int num_context_lines = -1
 Number of context lines to print around the underlined text. More...
 
bool syntax_sugar = true
 Whether to output with syntax sugar, set false for complete printing. More...
 
bool show_object_address = false
 Whether variable names should include the object's address. More...
 
ffi::Array< ffi::reflection::AccessPath > path_to_underline
 
ffi::Map< ffi::reflection::AccessPath, ffi::String > path_to_annotate
 ffi::Object path to be annotated. More...
 
ffi::Array< ffi::ObjectRef > obj_to_underline = ffi::Array<ffi::ObjectRef>()
 ffi::Object to be underlined. More...
 
ffi::Map< ffi::ObjectRef, ffi::String > obj_to_annotate = ffi::Map<ffi::ObjectRef, ffi::String>()
 ffi::Object to be annotated. More...
 
ffi::Map< ffi::String, ffi::Any > extra_config
 Generic extension map for dialect-specific config knobs. More...
 

Static Public Attributes

static constexpr const bool _type_mutable = true
 

Member Function Documentation

◆ GetBuiltinKeywords()

ffi::Array<ffi::String> tvm::PrinterConfigNode::GetBuiltinKeywords ( )

◆ GetExtraConfig()

template<typename T >
T tvm::PrinterConfigNode::GetExtraConfig ( const ffi::String &  key,
fallback 
) const
inline

Look up a value in extra_config with type cast and fallback.

Keys are conventionally namespaced as "<dialect>.<knob>" (e.g. "tirx.prefix", "relax.show_all_struct_info").

◆ RegisterReflection()

static void tvm::PrinterConfigNode::RegisterReflection ( )
inlinestatic

◆ TVM_FFI_DECLARE_OBJECT_INFO_FINAL()

tvm::PrinterConfigNode::TVM_FFI_DECLARE_OBJECT_INFO_FINAL ( "script.PrinterConfig"  ,
PrinterConfigNode  ,
ffi::Object   
)

Member Data Documentation

◆ _type_mutable

constexpr const bool tvm::PrinterConfigNode::_type_mutable = true
staticconstexpr

◆ binding_names

ffi::Array<ffi::String> tvm::PrinterConfigNode::binding_names = {}

A stack that tracks the names of the binding hierarchy.

◆ buffer_dtype

DataType tvm::PrinterConfigNode::buffer_dtype = DataType::Float(32)

Default buffer dtype.

◆ extra_config

ffi::Map<ffi::String, ffi::Any> tvm::PrinterConfigNode::extra_config

Generic extension map for dialect-specific config knobs.

Keys are conventionally namespaced as "<dialect>.<knob>", e.g.: "tirx.prefix" — the TIR prefix (default "T") "tirx.buffer_dtype" — default buffer dtype (default float32) "relax.prefix" — the Relax prefix (default "R") "relax.show_all_struct_info" — whether to show all struct info (default true)

Use GetExtraConfig<T>(key, fallback) to read values with a typed fallback.

◆ float_dtype

DataType tvm::PrinterConfigNode::float_dtype = DataType::Void()

Default data type of float literals. Right now we always print out the explicit type of floating point values, so setting it to Void means we do not print without the T.float32/T.float64 wrapper.

◆ indent_spaces

int tvm::PrinterConfigNode::indent_spaces = 4

Number of spaces used for indentation.

◆ int_dtype

DataType tvm::PrinterConfigNode::int_dtype = DataType::Int(32)

Default data type of integer literals.

◆ ir_prefix

ffi::String tvm::PrinterConfigNode::ir_prefix = "I"

The prefix of IR nodes.

◆ module_alias

ffi::String tvm::PrinterConfigNode::module_alias = "cls"

The alias of the current module at cross-function call.

Note
Directly use module name if it's empty.

◆ num_context_lines

int tvm::PrinterConfigNode::num_context_lines = -1

Number of context lines to print around the underlined text.

◆ obj_to_annotate

ffi::Map<ffi::ObjectRef, ffi::String> tvm::PrinterConfigNode::obj_to_annotate = ffi::Map<ffi::ObjectRef, ffi::String>()

ffi::Object to be annotated.

◆ obj_to_underline

ffi::Array<ffi::ObjectRef> tvm::PrinterConfigNode::obj_to_underline = ffi::Array<ffi::ObjectRef>()

ffi::Object to be underlined.

◆ path_to_annotate

ffi::Map<ffi::reflection::AccessPath, ffi::String> tvm::PrinterConfigNode::path_to_annotate

ffi::Object path to be annotated.

◆ path_to_underline

ffi::Array<ffi::reflection::AccessPath> tvm::PrinterConfigNode::path_to_underline

◆ print_line_numbers

bool tvm::PrinterConfigNode::print_line_numbers = false

Whether to print line numbers.

◆ relax_prefix

ffi::String tvm::PrinterConfigNode::relax_prefix = "R"

The prefix of Relax nodes.

◆ show_meta

bool tvm::PrinterConfigNode::show_meta = false

Whether or not to show metadata.

◆ show_object_address

bool tvm::PrinterConfigNode::show_object_address = false

Whether variable names should include the object's address.

◆ syntax_sugar

bool tvm::PrinterConfigNode::syntax_sugar = true

Whether to output with syntax sugar, set false for complete printing.

◆ tir_import_module

ffi::String tvm::PrinterConfigNode::tir_import_module = "tir"

The TIR module name used in the printed import (e.g. "tir" or "tirx"). Used in the header comment: "from tvm.script import <tir_import_module> as <tir_prefix>". When tir_prefix is "Tx", set to "tirx" so the printed script uses "import tirx as Tx".

◆ tir_prefix

ffi::String tvm::PrinterConfigNode::tir_prefix = "T"

The prefix of TIR nodes.

◆ tirx_prefix

ffi::String tvm::PrinterConfigNode::tirx_prefix = "Tx"

The prefix of TIRX nodes.

◆ verbose_expr

bool tvm::PrinterConfigNode::verbose_expr = false

Whether or not to verbose print expressions.


The documentation for this class was generated from the following file: