Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PLR0124 #2422

Merged
merged 2 commits into from
Jun 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 8 additions & 6 deletions test/core/test_tensor_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def test_accessors(self, device, dtype):
def test_unary_ops(self, device, dtype):
data = torch.rand(2, device=device, dtype=dtype)
x = TensorWrapper(data)
x1 = TensorWrapper(data)
x2 = TensorWrapper(data)

self.assert_close(x.add(x), x + x)
self.assert_close(x.add(1), 1 + x)
Expand All @@ -78,12 +80,12 @@ def test_unary_ops(self, device, dtype):
self.assert_close(x.div(x), x / x)
self.assert_close(x.true_divide(x), x / x)
self.assert_close(x.floor_divide(x), x // x)
self.assert_close(x.ge(x), x >= x)
self.assert_close(x.gt(x), x > x)
self.assert_close(x.lt(x), x < x)
self.assert_close(x.le(x), x <= x)
self.assert_close(x.eq(x), x == x)
self.assert_close(x.ne(x), x != x)
self.assert_close(x1.ge(x2), x1 >= x2)
self.assert_close(x1.gt(x2), x1 > x2)
self.assert_close(x1.lt(x2), x1 < x2)
self.assert_close(x1.le(x2), x1 <= x2)
self.assert_close(x1.eq(x2), x1 == x2)
self.assert_close(x1.ne(x2), x1 != x2)
self.assert_close(-x, -data)

def test_callable(self, device, dtype):
Expand Down