Skip to content

[BugFix] Single-cpu compatibility #548

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions test/test_tensor_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def test_equality_bounded(self):
ts_other = BoundedTensorSpec(minimum, maximum + 1, device, dtype)
assert ts != ts_other

ts_other = BoundedTensorSpec(minimum, maximum, "cpu:2", dtype)
ts_other = BoundedTensorSpec(minimum, maximum, "cpu:0", dtype)
assert ts != ts_other

ts_other = BoundedTensorSpec(minimum, maximum, device, torch.float64)
Expand All @@ -435,7 +435,7 @@ def test_equality_onehot(self):
ts_other = OneHotDiscreteTensorSpec(n + 1, device, dtype, use_register)
assert ts != ts_other

ts_other = OneHotDiscreteTensorSpec(n, "cpu:2", dtype, use_register)
ts_other = OneHotDiscreteTensorSpec(n, "cpu:0", dtype, use_register)
assert ts != ts_other

ts_other = OneHotDiscreteTensorSpec(n, device, torch.float64, use_register)
Expand All @@ -458,7 +458,7 @@ def test_equality_unbounded(self):
ts_same = UnboundedContinuousTensorSpec(device, dtype)
assert ts == ts_same

ts_other = UnboundedContinuousTensorSpec("cpu:2", dtype)
ts_other = UnboundedContinuousTensorSpec("cpu:0", dtype)
assert ts != ts_other

ts_other = UnboundedContinuousTensorSpec(device, torch.float64)
Expand Down Expand Up @@ -495,7 +495,7 @@ def test_equality_ndbounded(self):
assert ts != ts_other

ts_other = NdBoundedTensorSpec(
minimum=minimum, maximum=maximum, device="cpu:2", dtype=dtype
minimum=minimum, maximum=maximum, device="cpu:0", dtype=dtype
)
assert ts != ts_other

Expand Down Expand Up @@ -535,7 +535,7 @@ def test_equality_ndunbounded(self, shape):
assert ts != ts_other

ts_other = NdUnboundedContinuousTensorSpec(
shape=shape, device="cpu:2", dtype=dtype
shape=shape, device="cpu:0", dtype=dtype
)
assert ts != ts_other

Expand All @@ -562,7 +562,7 @@ def test_equality_binary(self):
ts_other = BinaryDiscreteTensorSpec(n=n + 5, device=device, dtype=dtype)
assert ts != ts_other

ts_other = BinaryDiscreteTensorSpec(n=n, device="cpu:2", dtype=dtype)
ts_other = BinaryDiscreteTensorSpec(n=n, device="cpu:0", dtype=dtype)
assert ts != ts_other

ts_other = BinaryDiscreteTensorSpec(n=n, device=device, dtype=torch.float64)
Expand Down Expand Up @@ -601,7 +601,7 @@ def test_equality_multi_onehot(self, nvec):
)
assert ts != ts_other

ts_other = MultOneHotDiscreteTensorSpec(nvec=nvec, device="cpu:2", dtype=dtype)
ts_other = MultOneHotDiscreteTensorSpec(nvec=nvec, device="cpu:0", dtype=dtype)
assert ts != ts_other

ts_other = MultOneHotDiscreteTensorSpec(
Expand Down