mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Added cummin
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/32238 Differential Revision: D19416791 Pulled By: anjali411 fbshipit-source-id: 5aadc0a7a55af40d76f444ab7d7d47ec822f55a5
This commit is contained in:
committed by
Facebook Github Bot
parent
78d8f691ad
commit
5b815d980e
@ -977,13 +977,16 @@ class TestNamedTensor(TestCase):
|
||||
for testcase, device in itertools.product(tests, torch.testing.get_all_device_types()):
|
||||
_test(testcase, device=device)
|
||||
|
||||
def test_cummax(self):
|
||||
for device in torch.testing.get_all_device_types():
|
||||
names = ('N', 'D')
|
||||
tensor = torch.rand(2, 3, names=names)
|
||||
result = torch.cummax(tensor, 0)
|
||||
self.assertEqual(result[0].names, names)
|
||||
self.assertEqual(result[1].names, names)
|
||||
def test_cummax_cummin(self):
|
||||
def test_ops(op):
|
||||
for device in torch.testing.get_all_device_types():
|
||||
names = ('N', 'D')
|
||||
tensor = torch.rand(2, 3, names=names)
|
||||
result = op(tensor, 0)
|
||||
self.assertEqual(result[0].names, names)
|
||||
self.assertEqual(result[1].names, names)
|
||||
test_ops(torch.cummax)
|
||||
test_ops(torch.cummin)
|
||||
|
||||
def test_bitwise_not(self):
|
||||
for device in torch.testing.get_all_device_types():
|
||||
|
Reference in New Issue
Block a user