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
Implement functions from np.random #46
Conversation
Currently I get following error:
|
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.
A lot of these don't take in array_like
arguments at all. Most of them (not all) should just be return ()
paired with identity_argreplacer
.
Try to be a bit more careful with your dispatcher and arg-replacer. The dispatcher extracts array_like
arguments and dtype
s.
unumpy/numpy_backend.py
Outdated
@@ -24,11 +24,13 @@ def __ua_function__(method, args, kwargs): | |||
if method in _implementations: | |||
return _implementations[method](*args, **kwargs) | |||
|
|||
if not hasattr(np, method.__name__): | |||
if hasattr(np, method.__name__): |
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.
This should be replaced by checking the __module__
of the method
.
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.
Not sure about this :/
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.
You have to check method.__module__
. It will be different depending on the submodule that the method is in.
For simplicity, you can also move everything in _multimethods.py
to __init__.py
.
Superceded by #73. |
Might take over this eventually if that's okay. |
WIP