mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Add missing __main__ in two unittests (#97302)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97302 Approved by: https://github.com/zou3519
This commit is contained in:
committed by
PyTorch MergeBot
parent
28929b1205
commit
726fc366a2
@ -2,7 +2,7 @@
|
||||
# Owner(s): ["module: internals"]
|
||||
|
||||
import torch
|
||||
from torch.testing._internal.common_utils import TestCase
|
||||
from torch.testing._internal.common_utils import TestCase, run_tests
|
||||
|
||||
class TestComparisonUtils(TestCase):
|
||||
def test_all_equal_no_assert(self):
|
||||
@ -30,3 +30,7 @@ class TestComparisonUtils(TestCase):
|
||||
|
||||
with self.assertRaises(RuntimeError):
|
||||
torch._assert_tensor_metadata(t, [3], [1], torch.float)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
run_tests()
|
||||
|
@ -4,7 +4,7 @@ import hypothesis.strategies as st
|
||||
from hypothesis import given
|
||||
import numpy as np
|
||||
import torch
|
||||
from torch.testing._internal.common_utils import TestCase
|
||||
from torch.testing._internal.common_utils import TestCase, run_tests
|
||||
import torch.testing._internal.hypothesis_utils as hu
|
||||
hu.assert_deadline_disabled()
|
||||
|
||||
@ -76,3 +76,7 @@ class PruningOpTest(TestCase):
|
||||
)
|
||||
def test_rowwise_prune_op_64bit_indices(self, embedding_rows, embedding_dims, weights_dtype):
|
||||
self._test_rowwise_prune_op(embedding_rows, embedding_dims, torch.int64, weights_dtype)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
run_tests()
|
||||
|
Reference in New Issue
Block a user