@@ -44,7 +44,7 @@ class PrinterConfig(Object):
4444 num_context_lines : int
4545 syntax_sugar : bool
4646 show_object_address : bool
47- show_inferable_type_annotations : bool
47+ show_all_struct_info : bool
4848 path_to_underline : Optional [List [ObjectPath ]]
4949 path_to_annotate : Optional [Dict [ObjectPath , str ]]
5050 obj_to_underline : Optional [List [Object ]]
@@ -68,7 +68,7 @@ def __init__(
6868 num_context_lines : Optional [int ] = None ,
6969 syntax_sugar : bool = True ,
7070 show_object_address : bool = False ,
71- show_inferable_type_annotations : bool = True ,
71+ show_all_struct_info : bool = True ,
7272 path_to_underline : Optional [List [ObjectPath ]] = None ,
7373 path_to_annotate : Optional [Dict [ObjectPath , str ]] = None ,
7474 obj_to_underline : Optional [List [Object ]] = None ,
@@ -91,7 +91,7 @@ def __init__(
9191 "num_context_lines" : num_context_lines ,
9292 "syntax_sugar" : syntax_sugar ,
9393 "show_object_address" : show_object_address ,
94- "show_inferable_type_annotations " : show_inferable_type_annotations ,
94+ "show_all_struct_info " : show_all_struct_info ,
9595 "path_to_underline" : path_to_underline ,
9696 "path_to_annotate" : path_to_annotate ,
9797 "obj_to_underline" : obj_to_underline ,
@@ -135,7 +135,7 @@ def script(
135135 num_context_lines : int = - 1 ,
136136 syntax_sugar : bool = True ,
137137 show_object_address : bool = False ,
138- show_inferable_type_annotations : bool = True ,
138+ show_all_struct_info : bool = True ,
139139 path_to_underline : Optional [List [ObjectPath ]] = None ,
140140 path_to_annotate : Optional [Dict [ObjectPath , str ]] = None ,
141141 obj_to_underline : Optional [List [Object ]] = None ,
@@ -176,9 +176,10 @@ def script(
176176 Whether to output with syntax sugar, set false for complete printing.
177177 show_object_address: bool = False
178178 Whether to include the object's address as part of the TVMScript name
179- show_inferable_type_annotations: bool = True
180- Whether to show type annotations that can be inferred from previous
181- annotations.
179+ show_all_struct_info: bool = True
180+ If True (default), annotate all variable bindings with the struct
181+ info of that variable. If False, only add annotations where
182+ required for unambiguous round-trip of Relax -> TVMScript -> Relax.
182183 path_to_underline : Optional[List[ObjectPath]] = None
183184 Object path to be underlined
184185 path_to_annotate : Optional[Dict[ObjectPath, str]] = None
@@ -192,6 +193,7 @@ def script(
192193 -------
193194 script : str
194195 The TVM Script of the given TVM IR
196+
195197 """
196198 return _script (
197199 self ,
@@ -211,7 +213,7 @@ def script(
211213 num_context_lines = num_context_lines ,
212214 syntax_sugar = syntax_sugar ,
213215 show_object_address = show_object_address ,
214- show_inferable_type_annotations = show_inferable_type_annotations ,
216+ show_all_struct_info = show_all_struct_info ,
215217 path_to_underline = path_to_underline ,
216218 path_to_annotate = path_to_annotate ,
217219 obj_to_underline = obj_to_underline ,
@@ -287,7 +289,7 @@ def show(
287289 num_context_lines : int = - 1 ,
288290 syntax_sugar : bool = True ,
289291 show_object_address : bool = False ,
290- show_inferable_type_annotations : bool = True ,
292+ show_all_struct_info : bool = True ,
291293 path_to_underline : Optional [List [ObjectPath ]] = None ,
292294 path_to_annotate : Optional [Dict [ObjectPath , str ]] = None ,
293295 obj_to_underline : Optional [List [Object ]] = None ,
@@ -351,9 +353,10 @@ def show(
351353 Whether to output with syntax sugar, set false for complete printing.
352354 show_object_address: bool = False
353355 Whether to include the object's address as part of the TVMScript name
354- show_inferable_type_annotations: bool = True
355- Whether to show type annotations that can be inferred from previous
356- annotations.
356+ show_all_struct_info: bool = True
357+ If True (default), annotate all variable bindings with the struct
358+ info of that variable. If False, only add annotations where
359+ required for unambiguous round-trip of Relax -> TVMScript -> Relax.
357360 path_to_underline : Optional[List[ObjectPath]] = None
358361 Object path to be underlined
359362 path_to_annotate : Optional[Dict[ObjectPath, str]] = None
@@ -389,7 +392,7 @@ def show(
389392 num_context_lines = num_context_lines ,
390393 syntax_sugar = syntax_sugar ,
391394 show_object_address = show_object_address ,
392- show_inferable_type_annotations = show_inferable_type_annotations ,
395+ show_all_struct_info = show_all_struct_info ,
393396 path_to_underline = path_to_underline ,
394397 path_to_annotate = path_to_annotate ,
395398 obj_to_underline = obj_to_underline ,
0 commit comments