-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[numpy] Implement NumPy operators #14327
Comments
Hey, this is the MXNet Label Bot. |
@mxnet-label-bot Add [Feature request, Numpy] |
Great! I have the following questions. Could you please provide an example to explain how to accept In detail, how to determine the type of inputs? Slice and View (e.g. |
This can be achieved pretty similar to how
In fact, MXNet tensor can support view if we add strides implementation. It's just a matter of how elements are accessed. But that also means we need to re-implement all the kernels to support strides which is paramount of work with no performance gain. Although supporting view is a must-have to achieve the long-term goal of numpy compatibility, it's not the current focus of improving the model training usability as it introduces quite a few problems that will lead to negative user experience, such as view cannot be used in auto grad as an assignee because in-place assignment is not allowed, non-contiguous memory allocation breaks data locality which is critical in devising high-performance kernels. We would have more freedom of taking this into consideration in 2.0. |
@reminisce I see. Thank you! |
I made a list of operators that can be implemented using NumPy APIs. Most of the operators are extracted from the D2L book. I think we should prioritize these operators to benefit the wide audience of the book. Some operators, such as
one_hot
does not have the counterpart in NumPy. We can consider registering them under different namespaces thanmxnet.numpy
.Will revert some of the changes in this commit to restore namespace
mxnet.numpy
.The text was updated successfully, but these errors were encountered: