Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBI tests are not correctly using the backend #1351

Closed
Simone-Bordoni opened this issue Jun 7, 2024 · 2 comments · Fixed by #1276
Closed

DBI tests are not correctly using the backend #1351

Simone-Bordoni opened this issue Jun 7, 2024 · 2 comments · Fixed by #1276
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Simone-Bordoni
Copy link
Contributor

In test_models_dbi.py and test_models_dbi_utils.py there are a some tests that are not using correctly the backend.
For example in the test test_gradient_descent (test_models_dbi.py), when the function gradient_descent is called (line 248) the backend is not passed to the function.
Using the default backend=None, the function _check_backend will set the default numpy backend.
When correctly using the backend some errors appears.
For example in line 133 of utils_dbr_strategies.py where the lines:

params_new = backend.cast(d_params, copy=True)
params_new[i] += delta

Do not work with tensorflow (item assignment is not supported).

I am currently trying to fix the problem in #1276 however I nmay need some help as I don't know the DBI module.

@Simone-Bordoni Simone-Bordoni added the bug Something isn't working label Jun 7, 2024
@marekgluza
Copy link
Contributor

Thank you Simone! We will be in the Qibo meeting today and are generally available

@marekgluza
Copy link
Contributor

@MatteoRobbiati MatteoRobbiati added this to the Qibo 0.2.9 milestone Jun 11, 2024
@Simone-Bordoni Simone-Bordoni self-assigned this Jun 19, 2024
@Simone-Bordoni Simone-Bordoni linked a pull request Jun 19, 2024 that will close this issue
4 tasks
@scarrazza scarrazza modified the milestones: Qibo 0.2.9, Qibo 0.2.10 Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants