@@ -354,7 +354,7 @@ def _to_onnx_attr_ref(
354354 msg = f"Unsupported attribute type { pytype !r} ."
355355 fail (info .msg (msg ) if info else msg )
356356 attr_type = ir .AttributeType (ta .pytype_to_attrtype (pytype ))
357- return ir .Attr (attrname , attr_type , None , val .value )
357+ return ir .Attr (attrname , attr_type , None , val .value . name )
358358
359359 def _to_onnx_var (
360360 self ,
@@ -536,7 +536,7 @@ def _translate_attr(
536536 val = self ._lookup (expr .id , self ._source_of (expr ))
537537 if isinstance (val , values .AttrRef ):
538538 attr_type = ir .AttributeType (ta .pytype_to_attrtype (val .typeinfo ))
539- attr_ref = ir .Attr (attr_name , attr_type , None , val .value )
539+ attr_ref = ir .Attr (attr_name , attr_type , None , val .value . name )
540540 if attr_meta is not None and (attr_ref .type != attr_meta .type ):
541541 self .fail (
542542 expr ,
@@ -1459,7 +1459,7 @@ def _translate_function_signature_common(
14591459 attribute_type = ta .pytype_to_attrtype (typeinfo )
14601460 attr = ir .Attr (x .arg , ir .AttributeType (attribute_type ), default_value , None )
14611461 self ._current_fn .append_parameter (attr )
1462- self ._bind (x .arg , values .AttrRef (x . arg , typeinfo , self ._source_of (x )))
1462+ self ._bind (x .arg , values .AttrRef (attr , typeinfo , self ._source_of (x )))
14631463 else :
14641464 onnx_parameter = make_value (x .arg , typeinfo , self ._source_of (x ))
14651465 self ._current_fn .append_parameter (onnx_parameter )
0 commit comments