-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[Numpy] Basic indexing in symbolic interface of DeepNumpy #16621
Conversation
Change the error raised in _op.split Fix sanity issues
update Update _symbol.py fix Update _symbol.py fix Update symbol.py Update symbol.py update update try to fix fix bug Fix for hsplit and split fix try to fix try to fix try to fix try to fix fix bug fix lint fix slicing fix concatenate try to not use output_is_list Update test_numpy_gluon.py try to fix the basic indexing try to fix fix fix debug fix bug debug debug debug try to fix fix skip the zero-size ndarrays in MKLDNN Update multiarray.py fix bug Update ndarray.py remove debug fix bug try to fix Update test_numpy_gluon.py fix add back Update test_numpy_gluon.py Update test_numpy_gluon.py fix bug try to fix fix test
e8365e8
to
f299ad0
Compare
258aab9
to
a670f97
Compare
2efbf1d
to
232052c
Compare
226f928
to
3c67b8f
Compare
@sxjscience Issue #16887 is tagged as 1.6, but this PR introduces new functionality (so probably we do not want it in 1.6). Are you going to make another PR for 1.6 branch with the targeted fix for #16887 or should we drop 1.6 tag from that issue? |
@ptrendx Is it possible to include this into 1.6? It's more like a bug-fix because in the previous version, we haven't checked the consistency of hybridization. |
@ptrendx After a second thought, I think it would be better to fix the bug first. Let me extract part of this PR to a bugfix. |
python/mxnet/symbol/numpy/_symbol.py
Outdated
The name of this symbol, returns ``None`` for list symbol. | ||
""" | ||
if self.num_outputs > 1: | ||
return None |
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.
raise
instead of return
?
python/mxnet/ndarray/ndarray.py
Outdated
@@ -3125,6 +3128,26 @@ def _get_dim_size(start, stop, step): | |||
return dim_size | |||
|
|||
|
|||
def _get_slice_len_for(slc, seq_length): |
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.
nit: change _get_slice_len_for
to _get_slice_len
.
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.
Let me fix it in the other PR (#16902)
python/mxnet/symbol/numpy/_symbol.py
Outdated
-------- | ||
_Symbol.tojson : Used to save symbol into json string. | ||
""" | ||
if not isinstance(json_str, string_types): |
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.
Reuse mx.sym.load_json
?
python/mxnet/symbol/numpy/_symbol.py
Outdated
-------- | ||
Symbol.save : Used to save symbol into file. | ||
""" | ||
if not isinstance(fname, string_types): |
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.
Reuse mx.sym.load
?
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.
I've copied the code here because we need to return the _Symbol object.
Description
Continue #15905.
Add support of basic symbolic indexing, currently we support the following indexing types
Fixes the MKLDNN integration of MXNet, which does not support 0-size NDArray. Currently, the solution is to disable MKLDNN if the size of input is 0.
Support loading and saving symbols in the Numpy interface
Add two testing utility functions:
Once merged, this will fix #16279 and #16887
Followup work will be to support Ellipsis in the symbolic interface.
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes