We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ed171e6 commit a7bd0c0Copy full SHA for a7bd0c0
1 file changed
tests/unit/autojac/_transform/test_tensor_dict.py
@@ -120,3 +120,10 @@ def test_immutability():
120
t[torch.ones(1)] = torch.ones(1)
121
122
assert t == Gradients({})
123
+
124
125
+def test_empty_tensor_dict():
126
+ """Tests that it's impossible to instantiate a non-empty EmptyTensorDict."""
127
128
+ with raises(ValueError):
129
+ _ = EmptyTensorDict({torch.ones(1): torch.ones(1)})
0 commit comments