mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
prepare removal of deprecated functionality in torch.testing (#87969)
_Redo of #86586 with all BC breaking changes granularly placed into separate commits._ --- Per title. Deprecation happened on Feb 25, 2022 in c6f1bbc0ac33be0c8ad9956e3fc15e78ddb6cb95, which made it into the 1.12 release. Since it is now 245 days later and the next release will be 1.14, the removals later in the stack comply with the [BC policy](https://github.com/pytorch/pytorch/wiki/PyTorch's-Python-Frontend-Backward-and-Forward-Compatibility-Policy#minimizing-the-disruption-of-bc-breaking-changes). Pull Request resolved: https://github.com/pytorch/pytorch/pull/87969 Approved by: https://github.com/mruberry
This commit is contained in:
committed by
PyTorch MergeBot
parent
0fc7de3986
commit
bc73affdad
@ -797,7 +797,7 @@ class TestJitTraceAutocast(JitTestCase):
|
||||
y = traced_model(x.clone())
|
||||
with torch.cpu.amp.autocast(), torch.no_grad():
|
||||
y2 = model(x.clone())
|
||||
torch.testing.assert_allclose(y.double(), y2.double(), rtol=1e-03, atol=1e-03)
|
||||
torch.testing.assert_close(y.double(), y2.double(), rtol=1e-03, atol=1e-03)
|
||||
for i in range(self.models.__len__()):
|
||||
test_nchw_autocast_jit_trace_model(self.models[i], self.inputs[i])
|
||||
|
||||
@ -812,7 +812,7 @@ class TestJitTraceAutocast(JitTestCase):
|
||||
y = traced_model(x.clone().to(memory_format=torch.channels_last))
|
||||
with torch.cpu.amp.autocast(), torch.no_grad():
|
||||
y2 = model(x.clone().to(memory_format=torch.channels_last))
|
||||
torch.testing.assert_allclose(y.double(), y2.double(), rtol=1e-03, atol=1e-03)
|
||||
torch.testing.assert_close(y.double(), y2.double(), rtol=1e-03, atol=1e-03)
|
||||
for i in range(self.models.__len__()):
|
||||
if self.inputs[i].size().__len__() == 5:
|
||||
# NHWC 3D case not support yet
|
||||
|
Reference in New Issue
Block a user