Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lint
Browse files Browse the repository at this point in the history
vmoens committed Jul 5, 2024
1 parent 31ed32a commit fad25d9
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions test/test_tensordict.py
Original file line number Diff line number Diff line change
@@ -2439,22 +2439,12 @@ def dummy_td_2(self):

def test_ordering(self):

x0 = TensorDict(
{
"y": torch.zeros(3),
"x": torch.ones(3)
}
)
x0 = TensorDict({"y": torch.zeros(3), "x": torch.ones(3)})

x1 = TensorDict(
{
"x": torch.ones(3),
"y": torch.zeros(3)
}
)
assert ((x0+x1)["x"] == 2).all()
assert ((x0*x1)["x"] == 1).all()
assert ((x0-x1)["x"] == 0).all()
x1 = TensorDict({"x": torch.ones(3), "y": torch.zeros(3)})
assert ((x0 + x1)["x"] == 2).all()
assert ((x0 * x1)["x"] == 1).all()
assert ((x0 - x1)["x"] == 0).all()

@pytest.mark.parametrize("locked", [True, False])
def test_add(self, locked):

0 comments on commit fad25d9

Please sign in to comment.