-
Notifications
You must be signed in to change notification settings - Fork 60
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
small fixes #307
Conversation
Codecov Report
@@ Coverage Diff @@
## master #307 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 59 59
Lines 11213 11209 -4
=========================================
- Hits 11213 11209 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this 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.
src/qibo/hep/qpdf.py
Outdated
@@ -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))) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Few fixes to preserve the new code conventions.