Skip to content

Commit ee2fdfb

Browse files
committed
Minor fix
Signed-off-by: Ganesan Ramalingam <[email protected]>
1 parent 89c802a commit ee2fdfb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

onnxscript/_internal/converter.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,9 @@ def _to_onnx_var(
382382
)
383383
self._castable.add(result_name)
384384
return result
385-
if isinstance(val, values.Dynamic):
386-
return val.value
385+
if isinstance(val, values.SymbolValue):
386+
if isinstance(val.value, ir.Value):
387+
return val.value
387388
# Assume value is a python-value convertible to a tensor
388389
# TODO: check if value is convertible to a TensorProto, so that we can
389390
# produce a better error _message otherwise
@@ -1130,6 +1131,7 @@ def ret(exp, i, suffix):
11301131
preferred_name = f"return_val{suffix}"
11311132
return_var = self._translate_expr(exp, preferred_name) # TODO(rama)
11321133
val = self._lookup(return_var.name, self._source_of(exp), False)
1134+
# TODO(rama): Can we avoid using val.kind here? And rely on the ir.Value methods like is_graph_input()?
11331135
if val and val.kind == values.DynamicKind.Input:
11341136
# In ONNX, a graph-input cannot be an output of the graph.
11351137
# We need to insert a copy.

0 commit comments

Comments
 (0)