Skip to content

Commit

Permalink
Fix issue 38095 TODOs in test_jit (pytorch#82629)
Browse files Browse the repository at this point in the history
Fix TODOs related to pytorch#38095 in test_jit.py
Pull Request resolved: pytorch#82629
Approved by: https://github.com/clee2000, https://github.com/malfet
  • Loading branch information
kit1980 authored and pytorchmergebot committed Aug 3, 2022
1 parent 6d7b761 commit 58d1cf7
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions test/test_jit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5754,10 +5754,9 @@ def test_integral_shape_inference(a):
return a * a
''')
inputs = [torch.ones(10, 10, dtype=torch.long)]
outputs = torch.ones(10, 10)
outputs = torch.ones(10, 10, dtype=torch.long)

# TODO(#38095): Replace assertEqualIgnoreType. See issue #38095
self.assertEqualIgnoreType(cu.test_integral_shape_inference(*inputs), outputs)
self.assertEqual(cu.test_integral_shape_inference(*inputs), outputs)

@unittest.skipIf(RUN_CUDA, 'This tests the CPU fuser')
@unittest.skipIf(IS_SANDCASTLE, "NYI: fuser support for Sandcastle")
Expand Down Expand Up @@ -7327,9 +7326,7 @@ def func():
if inp == 'empty_list':
# torchscript returns int tensor, python returns float tensor
self.assertNotEqual(t1.dtype, t2.dtype)

# TODO(#38095): Replace assertEqualIgnoreType. See issue #38095
self.assertEqualIgnoreType(t1, t2)
self.assertEqual(t1, t2, exact_dtype=False)
self.assertEqual(t1.device, t2.device)

@unittest.skipIf(GRAPH_EXECUTOR != ProfilingMode.LEGACY, "Simple Executor doesn't have any shapes to propagate")
Expand Down Expand Up @@ -15354,8 +15351,7 @@ def forward(self, key):
# TODO: re-enable module hook when Python printing of attributes is
# supported
m = M({char : torch.ones(1) + ord(char) - ord("a") for char in "abcdefg"})
# TODO(#38095): Replace assertEqualIgnoreType. See issue #38095
self.assertEqualIgnoreType(m("c"), torch.tensor([103]))
self.assertEqual(m("c"), torch.tensor([103.]))

def test_module_none_attrs(self):
class MyMod(torch.jit.ScriptModule):
Expand Down

0 comments on commit 58d1cf7

Please sign in to comment.