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

#include <script_printer.h>

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

Public Member Functions

void VisitAttrs (AttrVisitor *v)
 
Array< StringGetBuiltinKeywords ()
 
 TVM_DECLARE_FINAL_OBJECT_INFO (PrinterConfigNode, Object)
 
- Public Member Functions inherited from tvm::runtime::Object
uint32_t type_index () const
 
std::string GetTypeKey () const
 
size_t GetTypeKeyHash () const
 
template<typename TargetType >
bool IsInstance () const
 
bool unique () const
 
 Object ()
 
 Object (const Object &other)
 
 Object (Object &&other)
 
Objectoperator= (const Object &other)
 
Objectoperator= (Object &&other)
 

Public Attributes

Array< Stringbinding_names = {}
 A stack that tracks the names of the binding hierarchy. More...
 
bool show_meta = false
 Whether or not to show metadata. More...
 
std::string ir_prefix = "I"
 The prefix of IR nodes. More...
 
std::string tir_prefix = "T"
 The prefix of TIR nodes. More...
 
std::string relax_prefix = "R"
 The prefix of Relax nodes. More...
 
std::string module_alias = "cls"
 The alias of the current module at cross-function call. More...
 
DataType buffer_dtype = DataType::Float(32)
 Default data type of TIR buffer. 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...
 
bool show_all_struct_info = true
 In Relax, whether to show all StructInfo annotations. More...
 
Array< ObjectPathpath_to_underline = Array<ObjectPath>()
 
Map< ObjectPath, Stringpath_to_annotate = Map<ObjectPath, String>()
 Object path to be annotated. More...
 
Array< ObjectRefobj_to_underline = Array<ObjectRef>()
 Object to be underlined. More...
 
Map< ObjectRef, Stringobj_to_annotate = Map<ObjectRef, String>()
 Object to be annotated. More...
 

Static Public Attributes

static constexpr const char * _type_key = "node.PrinterConfig"
 
- Static Public Attributes inherited from tvm::runtime::Object
static constexpr const char * _type_key = "runtime.Object"
 
static constexpr bool _type_final = false
 
static constexpr uint32_t _type_child_slots = 0
 
static constexpr bool _type_child_slots_can_overflow = true
 
static constexpr bool _type_has_method_visit_attrs = true
 
static constexpr bool _type_has_method_sequal_reduce = false
 
static constexpr bool _type_has_method_shash_reduce = false
 
static constexpr uint32_t _type_index = TypeIndex::kDynamic
 

Additional Inherited Members

- Public Types inherited from tvm::runtime::Object
typedef void(* FDeleter) (Object *self)
 Object deleter. More...
 
using RefCounterType = std::atomic< int32_t >
 
- Static Public Member Functions inherited from tvm::runtime::Object
static std::string TypeIndex2Key (uint32_t tindex)
 Get the type key of the corresponding index from runtime. More...
 
static size_t TypeIndex2KeyHash (uint32_t tindex)
 Get the type key hash of the corresponding index from runtime. More...
 
static uint32_t TypeKey2Index (const std::string &key)
 Get the type index of the corresponding key from runtime. More...
 
static uint32_t _GetOrAllocRuntimeTypeIndex ()
 
static uint32_t RuntimeTypeIndex ()
 
- Protected Member Functions inherited from tvm::runtime::Object
void IncRef ()
 developer function, increases reference counter. More...
 
void DecRef ()
 developer function, decrease reference counter. More...
 
- Static Protected Member Functions inherited from tvm::runtime::Object
static uint32_t GetOrAllocRuntimeTypeIndex (const std::string &key, uint32_t static_tindex, uint32_t parent_tindex, uint32_t type_child_slots, bool type_child_slots_can_overflow)
 Get the type index using type key. More...
 
- Protected Attributes inherited from tvm::runtime::Object
uint32_t type_index_ {0}
 Type index(tag) that indicates the type of the object. More...
 
RefCounterType ref_counter_ {0}
 The internal reference counter. More...
 
FDeleter deleter_ = nullptr
 deleter of this object to enable customized allocation. If the deleter is nullptr, no deletion will be performed. The creator of the object must always set the deleter field properly. More...
 

Member Function Documentation

◆ GetBuiltinKeywords()

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

◆ TVM_DECLARE_FINAL_OBJECT_INFO()

tvm::PrinterConfigNode::TVM_DECLARE_FINAL_OBJECT_INFO ( PrinterConfigNode  ,
Object   
)

◆ VisitAttrs()

void tvm::PrinterConfigNode::VisitAttrs ( AttrVisitor v)
inline

Member Data Documentation

◆ _type_key

constexpr const char* tvm::PrinterConfigNode::_type_key = "node.PrinterConfig"
staticconstexpr

◆ binding_names

Array<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 data type of TIR buffer.

◆ 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

std::string tvm::PrinterConfigNode::ir_prefix = "I"

The prefix of IR nodes.

◆ module_alias

std::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

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

Object to be annotated.

◆ obj_to_underline

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

Object to be underlined.

◆ path_to_annotate

Map<ObjectPath, String> tvm::PrinterConfigNode::path_to_annotate = Map<ObjectPath, String>()

Object path to be annotated.

◆ path_to_underline

Array<ObjectPath> tvm::PrinterConfigNode::path_to_underline = Array<ObjectPath>()

◆ print_line_numbers

bool tvm::PrinterConfigNode::print_line_numbers = false

Whether to print line numbers.

◆ relax_prefix

std::string tvm::PrinterConfigNode::relax_prefix = "R"

The prefix of Relax nodes.

◆ show_all_struct_info

bool tvm::PrinterConfigNode::show_all_struct_info = true

In Relax, whether to show all StructInfo annotations.

If true (default), all variable bindings will be annotated with the struct info of the variable being bound.

If false, the annotations will only be shown when they are required for correct parsing of the Relax function. For example, function parameters must always have struct info annotations, but the struct info for expressions within a function body may be inferred from their arguments, and are therefore

Example:

# func.show(show_all_struct_info=True)
@R.function
def func(
A: R.Tensor((10, 20), dtype="float32"),
B: R.Tensor((10,20), dtype="float32"),
) -> R.Tensor((10, 20), dtype="float32"):
C: R.Tensor((10,20), dtype="float32") = R.add(A, B2)
return C
# func.show(show_all_struct_info=False)
@R.function
def func(
A: R.Tensor((10, 20), dtype="float32"),
B: R.Tensor((10,20), dtype="float32"),
) -> R.Tensor((10, 20), dtype="float32"):
C = R.add(A, B2)
return C

◆ 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_prefix

std::string tvm::PrinterConfigNode::tir_prefix = "T"

The prefix of TIR 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: