Skip to content

Commit

Permalink
Fix more issues in tests
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Normandin <[email protected]>
  • Loading branch information
lebrice committed Jul 18, 2024
1 parent 120672e commit 3e3affe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
13 changes: 2 additions & 11 deletions project/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,17 +522,8 @@ def network(
if any(torch.nn.parameter.is_lazy(p) for p in network.parameters()):
# a bit ugly, but we need to initialize any lazy weights before we pass the network
# to the tests.
try:
_ = network(input)
except RuntimeError as err:
# TODO: Investigate the false positives with example_from_config, resnets, cifar10
logger.error(f"Error when running the network: {err}")
request.node.add_marker(
pytest.mark.xfail(
raises=RuntimeError,
reason="Network doesn't seem to be compatible this dataset.",
)
)
# TODO: Investigate the false positives with example_from_config, resnets, cifar10
_ = network(input)
return network


Expand Down
4 changes: 2 additions & 2 deletions project/main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ def test_jax_can_use_the_GPU():

device = jax.numpy.zeros(1).devices().pop()
if shutil.which("nvidia-smi"):
assert device.type == "GPU"
assert str(device) == "cuda:0"
else:
assert device.type == "CPU"
assert str(device) == "cpu"


def test_torch_can_use_the_GPU():
Expand Down

0 comments on commit 3e3affe

Please sign in to comment.