Skip to content

Commit c8914af

Browse files
gchananfacebook-github-bot
authored andcommitted
Merge criterion_tests and new_criterion_tests. (#44398)
Summary: Pull Request resolved: #44398 These end up executing the same tests, so no reason to have them separate. Test Plan: Imported from OSS Reviewed By: mruberry Differential Revision: D23600855 Pulled By: gchanan fbshipit-source-id: 0952492771498bf813f1bf8e1d7c8dce574ec965
1 parent fa158c4 commit c8914af

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

test/test_cpp_api_parity.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class TestCppApiParity(common.TestCase):
3131
(common_nn.module_tests, common_nn.ModuleTest),
3232
(common_nn.new_module_tests, common_nn.NewModuleTest),
3333
(common_nn.criterion_tests, common_nn.CriterionTest),
34-
(common_nn.new_criterion_tests, common_nn.CriterionTest),
3534
]:
3635
for test_params_dict in test_params_dicts:
3736
if test_params_dict.get('test_cpp_api_parity', True):

test/test_jit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
get_call, script_template, EXCLUDE_SCRIPT, additional_module_tests, EXCLUDE_SCRIPT_MODULES, \
6262
get_nn_module_name_from_kwargs, script_method_template, create_traced_fn
6363

64-
from torch.testing._internal.common_nn import module_tests, new_module_tests, criterion_tests, new_criterion_tests
64+
from torch.testing._internal.common_nn import module_tests, new_module_tests, criterion_tests
6565
from torch.testing._internal.common_methods_invocations import method_tests as autograd_method_tests
6666
from torch.testing._internal.common_methods_invocations import create_input, unpack_variables, \
6767
exclude_tensor_method, EXCLUDE_GRADCHECK, EXCLUDE_FUNCTIONAL
@@ -15831,7 +15831,7 @@ def test_version(self):
1583115831
for test in module_tests + new_module_tests + additional_module_tests:
1583215832
add_nn_module_test(**test)
1583315833

15834-
for test in criterion_tests + new_criterion_tests:
15834+
for test in criterion_tests:
1583515835
test['no_grad'] = True
1583615836
add_nn_module_test(**test)
1583715837

test/test_nn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
ALL_TENSORTYPES2, TemporaryFileName, TEST_WITH_UBSAN, IS_PPC
4040
from torch.testing._internal.common_cuda import TEST_CUDA, TEST_MULTIGPU, TEST_CUDNN, TEST_CUDNN_VERSION
4141
from torch.testing._internal.common_nn import NNTestCase, NewModuleTest, CriterionTest, \
42-
module_tests, criterion_tests, new_criterion_tests, loss_reference_fns, \
42+
module_tests, criterion_tests, loss_reference_fns, \
4343
ctcloss_reference, new_module_tests
4444
from torch.testing._internal.common_device_type import instantiate_device_type_tests, dtypes, \
4545
dtypesIfCUDA, skipCUDAIfNoCudnn, skipCUDAIfCudnnVersionLessThan, onlyCUDA, onlyCPU, \
@@ -8753,7 +8753,7 @@ def reference_fn(i, p, m):
87538753

87548754
add_test(test, decorator)
87558755

8756-
for test_params in criterion_tests + new_criterion_tests:
8756+
for test_params in criterion_tests:
87578757
name = test_params.pop('module_name')
87588758
test_params['constructor'] = getattr(nn, name)
87598759
test = CriterionTest(**test_params)

torch/testing/_internal/common_nn.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4152,9 +4152,6 @@ def padding3d_circular(input, pad):
41524152
desc='margin',
41534153
check_sum_reduction=True,
41544154
),
4155-
]
4156-
4157-
new_criterion_tests = [
41584155
dict(
41594156
module_name='BCEWithLogitsLoss',
41604157
input_fn=lambda: torch.rand(15, 10).clamp_(1e-2, 1 - 1e-2),

0 commit comments

Comments
 (0)