-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[Numpy] cumprod #15855
base: master
Are you sure you want to change the base?
[Numpy] cumprod #15855
Conversation
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.
shall we put it into another namespace? it seems not to be "ufunc" in terms of numpy definition: https://docs.scipy.org/doc/numpy/reference/ufuncs.html
I created 2 new files: cumprod.py and cumprod.cc. If there are better namespaces, plz let me know. |
Regarding the namespace choice in the frontend (python), how about we just follow what NumPy does? For example, |
Great! I created two files:
|
contrib/tvmop/core/fromnumeric.py
Outdated
import topi | ||
from .. import defop, AllTypes, AllTypesButHalf | ||
|
||
def kernel_cumprod(X, ishape, dtype, ndim, axis): |
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.
Suggestion: Maybe we can make this a common scan kernel, so that in the future similar scan operators could re-use 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.
Good. I will do it. What about moving the generalized kernel to contrib/tvmop/utils.py
?
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.
LGTM, please rebase.
Have Rebased. And a minor change: move the dispatch of req to func |
Another minor modification: Rename |
@hzfan Could you disable fp16 on cuda for now? We will fix it later. |
0ddab9f
to
6122559
Compare
Description
Use tvm to implement numpy compatible cumprod
Changes
Comments