-
-
Notifications
You must be signed in to change notification settings - Fork 50
change np.ones
patterns to np.full
#168
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
Conversation
Hi @mmcky , would you mind to review this? I'm not sure why the build is failing. |
@jstac the lecture |
@shlff there seems to be an issue with ---------------------------------------------------------------------------
TypingError Traceback (most recent call last)
<ipython-input-7-a1d4eb67d899> in <module>
1 cw = CareerWorkerProblem()
2 T, get_greedy = operator_factory(cw)
----> 3 v_star = solve_model(cw, verbose=False)
4 greedy_star = get_greedy(v_star)
5
<ipython-input-6-aefaf00ce40e> in solve_model(cw, use_parallel, tol, max_iter, verbose, print_skip)
14
15 while i < max_iter and error > tol:
---> 16 v_new = T(v)
17 error = np.max(np.abs(v - v_new))
18 i += 1
~/anaconda3/envs/quantecon/lib/python3.8/site-packages/numba/core/dispatcher.py in _compile_for_args(self, *args, **kws)
413 e.patch_message(msg)
414
--> 415 error_rewrite(e, 'typing')
416 except errors.UnsupportedError as e:
417 # Something unsupported is present in the user code, add help info
~/anaconda3/envs/quantecon/lib/python3.8/site-packages/numba/core/dispatcher.py in error_rewrite(e, issue_type)
356 raise e
357 else:
--> 358 reraise(type(e), e, None)
359
360 argtypes = []
~/anaconda3/envs/quantecon/lib/python3.8/site-packages/numba/core/utils.py in reraise(tp, value, tb)
78 value = tp()
79 if value.__traceback__ is not tb:
---> 80 raise value.with_traceback(tb)
81 raise value
82
TypingError: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<built-in function matmul>) found for signature:
>>> matmul(array(float64, 1d, C), array(int64, 2d, C))
There are 2 candidate implementations:
- Of which 2 did not match due to:
Overload in function 'MatMul.generic': File: numba/core/typing/npydecl.py: Line 987.
With argument(s): '(array(float64, 1d, C), array(int64, 2d, C))':
Rejected as the implementation raised a specific error:
TypingError: '@' arguments must all have the same dtype
raised from /Users/matthewmckay/anaconda3/envs/quantecon/lib/python3.8/site-packages/numba/core/typing/npydecl.py:932
During: typing of intrinsic-call at <ipython-input-5-491a1abd86c9> (24)
File "<ipython-input-5-491a1abd86c9>", line 24:
def T(v):
<source elided>
v2 = θ[i] + G_mean + β * v[i, :] @ G_probs # New job
v3 = G_mean + F_mean + β * F_probs @ v @ G_probs # New life |
Co-authored-by: Daisuke Oyama <[email protected]>
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 all, much appreciated. |
Good morning @jstac and @oyamad , this PR fix #165 by replacing all
np.ones
patterns withnp.full
inlecture-python.myst
, suggested by @oyamad .