Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Update doc for mxnet.ndarray.elemwise_add#5898

Merged
piiswrong merged 3 commits intoapache:masterfrom
indhub:doc/elemwiseadd
Apr 27, 2017
Merged

Update doc for mxnet.ndarray.elemwise_add#5898
piiswrong merged 3 commits intoapache:masterfrom
indhub:doc/elemwiseadd

Conversation

@indhub
Copy link
Copy Markdown
Contributor

@indhub indhub commented Apr 19, 2017

@mli, @zackchase, @madjam, @nswamy, @Roshrini, @jiajiechen
Please review and merge.


Example::

>>> x = mx.nd.array([1, 2, 3, 4])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mli Are we making all examples python specific or is there plans to add example for other languages? How do we separate them?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not add python examples in .cc file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mli @piiswrong : I don't see this operator defined in the Python files. Any idea how to keep the description in the cc file and add the example elsewhere specific to Python?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@indhub, python specific examples should go to ndarray_doc.py. Also this does not have to be specific to Python.

Copy link
Copy Markdown
Contributor

@zackchase zackchase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not much language stuff to look at. Can @piiswrong or @mli double check examples before merging?

(4L, 3L, 2L)
"""

class elemwise_addDoc(NDArrayDoc):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to add this example in the C++ documentation without the python-ness?.
I feel this is a simple example and does not have be repeated in every language binding.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to write this example in a language neutral way. Is there any other function that has a language neutral example that I can use as reference?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see if Reshape helps.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved example into ndarray_doc.py

Copy link
Copy Markdown
Contributor

@zackchase zackchase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good here. I didn't spot any language issues. Resolve w @nswamy which examples to present and then @piiswrong - let's merge?

@madjam madjam added the Doc label Apr 20, 2017

>>> x = mx.nd.array([1, 2, 3, 4])
>>> y = mx.nd.array([1.1, 2.1, 3.1, 4.1])
>>> mx.nd.elemwise_add(x, y).asnumpy()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x + y also works. Should we document that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does x+y internally call elemwise_add?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@piiswrong
Copy link
Copy Markdown
Contributor

please fix lint

@piiswrong piiswrong merged commit f8c6df2 into apache:master Apr 27, 2017
@indhub indhub deleted the doc/elemwiseadd branch June 2, 2017 18:38
Guneet-Dhillon pushed a commit to Guneet-Dhillon/mxnet that referenced this pull request Sep 13, 2017
* Update doc for mxnet.ndarray.elemwise_add

* Update doc for elemwise_add. Move python examples into python file.

* Change pylintrc to disable invalid-name check.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants