Skip to content
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
7 changes: 6 additions & 1 deletion neurobench/benchmarks/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import snntorch
from torch import Tensor
import torch
import nir


class Benchmark:
Expand Down Expand Up @@ -228,6 +227,12 @@ def to_nir(self, dummy_input: Tensor, filename: str, **kwargs) -> None:
If the installed version of `snntorch` is less than `0.9.0`.

"""
try:
import nir
except ImportError:
raise ImportError(
"Exporting to NIR requires the `nir` package. Install it using `pip install nir`."
)
if snntorch.__version__ < "0.9.0":
raise ValueError("Exporting to NIR requires snntorch version >= 0.9.0")

Expand Down