Skip to content

Commit 5e2a946

Browse files
committed
overload
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
1 parent 3f99c05 commit 5e2a946

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

onnxscript/_internal/builder.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,16 +838,19 @@ def call_op(
838838

839839
def call(
840840
self,
841-
function: ir.Function,
841+
function: ir.Function | onnxscript.OnnxFunction,
842842
*args,
843843
_outputs: int | Sequence[str | ir.Value] | None = None,
844844
**kwargs,
845845
):
846846
"""Call a function as a single function node."""
847847
if isinstance(function, ir.Function):
848848
graph = function.graph
849+
elif isinstance(function, onnxscript.OnnxFunction):
850+
graph = function.graph()
851+
function = function.function_ir
849852
else:
850-
raise TypeError("Function must be an ir.Function")
853+
raise TypeError("Function must be an ir.Function or onnxscript.OnnxFunction")
851854

852855
if _outputs is None:
853856
_outputs = len(graph.outputs)

0 commit comments

Comments
 (0)