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

small fixes #307

Merged
merged 3 commits into from
Jan 8, 2021
Merged

small fixes #307

merged 3 commits into from
Jan 8, 2021

Conversation

scarrazza
Copy link
Member

Few fixes to preserve the new code conventions.

@codecov
Copy link

codecov bot commented Jan 7, 2021

Codecov Report

Merging #307 (9c59f7a) into master (7dcde6d) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #307   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           59        59           
  Lines        11213     11209    -4     
=========================================
- Hits         11213     11209    -4     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/qibo/models.py 100.00% <ø> (ø)
src/qibo/optimizers.py 100.00% <ø> (ø)
src/qibo/hep/qpdf.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7dcde6d...9c59f7a. Read the comment docs.

Copy link
Member

@stavros11 stavros11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes, looks good.

@@ -68,7 +66,7 @@ def predict(self, parameters, x):
if len(parameters) != self.nparams: # pragma: no cover
raise_error(
RuntimeError, 'Mismatch between number of parameters and model size.')
pdf = np.zeros(shape=(len(x), len(self.hamiltonian)))
pdf = K.np.zeros(shape=(len(x), len(self.hamiltonian)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note that if you like to explicitly specify the type of this tensor based on the Qibo precision you can use K.qnp.zeros(shape, dtype='DTYPE'), otherwise the default np.float64 will always be used. I think it is is simpler to keep it as it is with the numpy default type.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this comment, I think K.qnp makes sense here.

@scarrazza scarrazza merged commit 25bd944 into master Jan 8, 2021
@scarrazza scarrazza deleted the standardizenp branch February 6, 2021 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants