fix passing acc_dtype="" to Tensor.prod should fail (#7750)

similar to sum
This commit is contained in:
chenyu
2024-11-17 11:38:13 -05:00
committed by GitHub
parent 55707fd00d
commit df817297b6
2 changed files with 4 additions and 1 deletions

View File

@@ -1032,6 +1032,9 @@ class TestOps(unittest.TestCase):
helper_test_op([()], lambda x: x.prod(0))
helper_test_op([()], lambda x: x.prod(-1))
def test_prod_acc_dtype(self):
with self.assertRaises(AttributeError): Tensor([1.0, 2.0]).prod(acc_dtype="")
def test_min(self):
helper_test_op([(3,3)], lambda x: x.min())
helper_test_op([(45,3)], lambda x: x.min())