@@ -507,7 +507,7 @@ def optimize_onnx(self, graph: torch._C.Graph) -> torch._C.Graph:
507507 for k , t in folded .items ():
508508 c : torch ._C .Value = graph .create ("onnx::Constant" , 1 ).output ()
509509 assert isinstance (t , torch .Tensor )
510- c .node ().t_ ("value" , cast ( torch . Tensor , t ) )
510+ c .node ().t_ ("value" , t )
511511 graph .prependNode (c .node ())
512512 # TODO(twata): Determine folded nodes from original graph and document it
513513 self .node_doc_string [c .node ()] = f"Constant folded node: { input_table [k ]} "
@@ -1155,9 +1155,9 @@ def _convert(self) -> None:
11551155 GLOBALS .onnx_shape_inference = False
11561156 else :
11571157 to_utils .__IN_ONNX_EXPORT = True # type: ignore[attr-defined]
1158- sym_hel ._set_opset_version (self .opset_version ) # type: ignore[no-untyped-call]
1159- sym_hel ._set_operator_export_type (self .operator_export_type ) # type: ignore[no-untyped-call]
1160- sym_hel ._set_onnx_shape_inference ( # type: ignore[no-untyped-call]
1158+ sym_hel ._set_opset_version (self .opset_version ) # type: ignore[attr-defined, no-untyped-call]
1159+ sym_hel ._set_operator_export_type (self .operator_export_type ) # type: ignore[attr-defined, no-untyped-call]
1160+ sym_hel ._set_onnx_shape_inference ( # type: ignore[attr-defined, no-untyped-call]
11611161 False # TODO(twata): Use `self.onnx_shape_inference`
11621162 )
11631163 with record ("pfto.original_outputs" ):
@@ -1177,11 +1177,11 @@ def _convert(self) -> None:
11771177 else :
11781178 to_utils .__IN_ONNX_EXPORT = False # type: ignore[attr-defined]
11791179 if prev_opset_version is not None :
1180- sym_hel ._set_opset_version (prev_opset_version ) # type: ignore[no-untyped-call]
1180+ sym_hel ._set_opset_version (prev_opset_version ) # type: ignore[attr-defined, no-untyped-call]
11811181 if prev_export_type is not None :
1182- sym_hel ._set_operator_export_type (prev_export_type ) # type: ignore[no-untyped-call]
1182+ sym_hel ._set_operator_export_type (prev_export_type ) # type: ignore[attr-defined, no-untyped-call]
11831183 if prev_shape_inference is not None :
1184- sym_hel ._set_onnx_shape_inference (prev_shape_inference ) # type: ignore[no-untyped-call]
1184+ sym_hel ._set_onnx_shape_inference (prev_shape_inference ) # type: ignore[attr-defined, no-untyped-call]
11851185
11861186 def generate (self , f : Union [str , typing .IO ]) -> None :
11871187 with record ("pfto.write_to_file" ):
0 commit comments