diff --git a/examples/oneflow2onnx/nodes/CPU/test_math.py b/examples/oneflow2onnx/nodes/CPU/test_math.py index 99866f0..1763b91 100644 --- a/examples/oneflow2onnx/nodes/CPU/test_math.py +++ b/examples/oneflow2onnx/nodes/CPU/test_math.py @@ -22,6 +22,7 @@ def __init__(self) -> None: super(MathOps, self).__init__() def forward(self, x: flow.Tensor) -> flow.Tensor: + x = x / 1 y1 = x * x y2 = y1 / x y2 = y2 - x diff --git a/examples/oneflow2onnx/nodes/GPU/test_math.py b/examples/oneflow2onnx/nodes/GPU/test_math.py index 431e20c..eac3a67 100644 --- a/examples/oneflow2onnx/nodes/GPU/test_math.py +++ b/examples/oneflow2onnx/nodes/GPU/test_math.py @@ -22,6 +22,7 @@ def __init__(self) -> None: super(MathOps, self).__init__() def forward(self, x: flow.Tensor) -> flow.Tensor: + x = x / 1 y1 = x * x y2 = y1 / x y2 = y2 - x diff --git a/oneflow_onnx/oneflow2onnx/handlers/math.py b/oneflow_onnx/oneflow2onnx/handlers/math.py index 7c8e376..f2c3ad5 100644 --- a/oneflow_onnx/oneflow2onnx/handlers/math.py +++ b/oneflow_onnx/oneflow2onnx/handlers/math.py @@ -47,6 +47,7 @@ class BroadcastOp(common.BroadcastOp): @flow_op("scalar_mul", "Mul") @flow_op("scalar_add", "Add") +@flow_op("scalar_div", "Div") class ScalarBinaryOp: @classmethod def Version_6(cls, ctx, node, **kwargs):