Skip to content

Commit

Permalink
Revert "Corrected the ReduceSumSqure op to match the reference" (#6125)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinchuby committed May 3, 2024
1 parent 94ba8fc commit 9ee76ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion onnx/reference/ops/op_reduce_sum_square.py
Expand Up @@ -21,7 +21,7 @@ def _run(self, data, axes=None, keepdims=None): # type: ignore
class ReduceSumSquare_18(OpRunReduceNumpy):
def _run(self, data, axes=None, keepdims=1, noop_with_empty_axes=0): # type: ignore
if self.is_axes_empty(axes) and noop_with_empty_axes != 0: # type: ignore
return (data,)
return (np.square(data),)

axes = self.handle_axes(axes)
keepdims = keepdims != 0 # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion onnx/test/reference_evaluator_test.py
Expand Up @@ -738,7 +738,7 @@ def test_reduce_sum_square_18_empty_axes_noop(self):
x = np.arange(60).reshape((3, 4, 5)).astype(np.float32)
sess = ReferenceEvaluator(onnx_model)
got = sess.run(None, {"X": x})[0]
assert_allclose(x, got)
assert_allclose(x * x, got)

def test_greater(self):
X = make_tensor_value_info("X", TensorProto.FLOAT, [None, None])
Expand Down

0 comments on commit 9ee76ea

Please sign in to comment.