Skip to content

test_jax_bindings.py fails if optional jax dependency is not available #82

Description

@tvercaut

The first line of this test is currenty to import jax:

import jax
import numpy as np
import pytest
import torch
from test_config import DEVICES
import torchsparsegradutils as tsgu
import torchsparsegradutils.jax as tsgujax
# skip if JAX unavailable
pytest.importorskip("jax")
if not tsgujax.have_jax:
pytest.skip("JAX bindings unavailable, skipping jax tests", allow_module_level=True)
import jax.numpy as jnp

The import should be moved to after checking if jax is available.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions