Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 3, 2024
1 parent 192ecce commit 75f7783
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions tests/tests_fabric/utilities/test_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,20 @@
torch.optim.Adamax,
],
)
@pytest.mark.parametrize("src_device", [
torch.device("cpu"),
pytest.param(torch.device("cuda"), marks=RunIf(min_cuda_gpus=1)),
])
@pytest.mark.parametrize("dst_device", [
torch.device("cpu"),
pytest.param(torch.device("cuda"), marks=RunIf(min_cuda_gpus=1)),
])
@pytest.mark.parametrize(
"src_device",
[
torch.device("cpu"),
pytest.param(torch.device("cuda"), marks=RunIf(min_cuda_gpus=1)),
],
)
@pytest.mark.parametrize(
"dst_device",
[
torch.device("cpu"),
pytest.param(torch.device("cuda"), marks=RunIf(min_cuda_gpus=1)),
],
)
def test_optimizer_to_device(optimizer_class, src_device, dst_device):
# Optimizer with no state initialized
model = torch.nn.Linear(2, 2, device=src_device)
Expand Down

0 comments on commit 75f7783

Please sign in to comment.