diff --git a/test/test_transforms_tensor.py b/test/test_transforms_tensor.py index 2051cc7466c..84e9bd7408c 100644 --- a/test/test_transforms_tensor.py +++ b/test/test_transforms_tensor.py @@ -649,7 +649,7 @@ def test_compose(device): t = T.Compose([ lambda x: x, ]) - with pytest.raises(RuntimeError, match="Could not get name of python class object"): + with pytest.raises(RuntimeError, match="cannot call a value of type 'Tensor'"): torch.jit.script(t)