Skip to content

Commit d7c89f2

Browse files
committed
one fix
1 parent 5ce3275 commit d7c89f2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

onnx_array_api/graph_api/graph_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def __init__(
224224
self.constants_[node.output[0]] = node
225225
self.set_shape(node.output[0], self._get_tensor_shape(node))
226226
self.set_type(node.output[0], self._get_tensor_type(node))
227-
for f in proto.function:
227+
for f in proto.functions:
228228
self.add_function(f)
229229
else:
230230
raise NotImplementedError(

onnx_array_api/translate_api/builder_emitter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ def _emit_end_signature(self, **kwargs: Dict[str, Any]) -> List[str]:
134134
for init in self.inits:
135135
val = to_array(init)
136136
stype = str(val.dtype).split(".")[-1]
137-
rows.append(f" {init.name} = np.array({val.tolist()}, dtype=np.{stype})")
137+
name = self._clean_result_name(init.name)
138+
rows.append(f" {name} = np.array({val.tolist()}, dtype=np.{stype})")
138139
return rows
139140

140141
def _emit_begin_return(self, **kwargs: Dict[str, Any]) -> List[str]:

0 commit comments

Comments
 (0)