We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f99c05 commit 5e2a946Copy full SHA for 5e2a946
1 file changed
onnxscript/_internal/builder.py
@@ -838,16 +838,19 @@ def call_op(
838
839
def call(
840
self,
841
- function: ir.Function,
+ function: ir.Function | onnxscript.OnnxFunction,
842
*args,
843
_outputs: int | Sequence[str | ir.Value] | None = None,
844
**kwargs,
845
):
846
"""Call a function as a single function node."""
847
if isinstance(function, ir.Function):
848
graph = function.graph
849
+ elif isinstance(function, onnxscript.OnnxFunction):
850
+ graph = function.graph()
851
+ function = function.function_ir
852
else:
- raise TypeError("Function must be an ir.Function")
853
+ raise TypeError("Function must be an ir.Function or onnxscript.OnnxFunction")
854
855
if _outputs is None:
856
_outputs = len(graph.outputs)
0 commit comments