Skip to content

Commit

Permalink
fix: allowing for platform=None
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoLiegiBastonLiegi committed Apr 10, 2024
1 parent 96c2083 commit 96ff762
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/qibojit/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class MetaBackend:
"""Meta-backend class which takes care of loading the qibojit backends."""

@staticmethod
def load(platform: str) -> QibojitBackend:
def load(platform: str = None) -> QibojitBackend:
"""Loads the backend.
Args:
Expand All @@ -29,11 +29,11 @@ def load(platform: str) -> QibojitBackend:
return CupyBackend()
elif platform == "cuquantum":
return CuQuantumBackend()
else:
raise_error(
ValueError,
f"Unsupported platform, please use one among {PLATFORMS}.",
)
else: # pragma: no cover
try:
return CupyBackend()
except (ModuleNotFoundError, ImportError):
return NumbaBackend()

def list_available(self) -> dict:
"""Lists all the available qibojit backends."""
Expand Down

0 comments on commit 96ff762

Please sign in to comment.