Skip to content

Commit

Permalink
fixing tests/examples backend name
Browse files Browse the repository at this point in the history
  • Loading branch information
scarrazza committed May 4, 2021
1 parent 86a2706 commit fc9dffd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/reuploading_classifier/qlassifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def minimize(self, method='BFGS', options=None, compile=True):
from qibo import K
circuit = self.circuit(self.training_set[0])
for gate in circuit.queue:
if K.name not in {"tensorflow_defaulteinsum", "tensorflow_matmuleinsum"}:
if K.name != "tensorflow":
from qibo.config import raise_error
raise_error(RuntimeError,
'SGD VQE requires native Tensorflow '
Expand Down
2 changes: 1 addition & 1 deletion src/qibo/tests/test_evolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def test_scheduling_optimization(method, options, messages, trotter, filename):

if method == "sgd":
from qibo import K
if K.name not in {"tensorflow_defaulteinsum", "tensorflow_matmuleinsum"}:
if K.name != "tensorflow":
with pytest.raises(RuntimeError):
best, params, _ = adevp.minimize([0.5, 1], method=method, options=options,
messages=messages)
Expand Down
4 changes: 2 additions & 2 deletions src/qibo/tests_new/test_models_variational.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def test_vqe(backend, method, options, compile, filename):
"""Performs a VQE circuit minimization test."""
original_backend = qibo.get_backend()
original_threads = qibo.get_threads()
if (method == "sgd" or compile) and backend != "tensorflow_matmuleinsum":
if (method == "sgd" or compile) and backend != "tensorflow":
pytest.skip("Skipping SGD test for unsupported backend.")
qibo.set_backend(backend)

Expand Down Expand Up @@ -281,7 +281,7 @@ def test_qaoa_errors():
@pytest.mark.parametrize(test_names, test_values)
def test_qaoa_optimization(backend, method, options, trotter, filename):
original_backend = qibo.get_backend()
if method == "sgd" and backend != "tensorflow_matmuleinsum":
if method == "sgd" and backend != "tensorflow":
pytest.skip("Skipping SGD test for unsupported backend.")
qibo.set_backend(backend)
h = hamiltonians.XXZ(3, trotter=trotter)
Expand Down

0 comments on commit fc9dffd

Please sign in to comment.