-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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.
Minor fix requested in the review... otherwise looks good. Thanks for these fixes!
I'd update your overview text to say "fixes #xxxxxxx" so that it should trigger an auto-close when this PR is merged. I'm not sure if "refer to" works the same way.
src/operator/swapaxis.cc
Outdated
swapaxes(x, 0, 1) = [[ 1], | ||
[ 2], | ||
[ 3]] | ||
>>> x = mx.nd.array([[1, 2, 3]]) //(1,3) array |
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 comment breaks things. I'd just get rid of it... or put the comment on it's own line.
src/operator/swapaxis.cc
Outdated
[ 2, 3]], | ||
[[ 4, 5], | ||
[ 6, 7]]] // (2,2,2) array | ||
>>> x = mx.nd.array([[[ 0, 1],[ 2, 3]],[[ 4, 5],[ 6, 7]]]) // (2,2,2) array |
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.
Comment breaks things.
BTW, one reason I can a sort of see why there's this abstraction from Python-specific code, is that this docstrings are pulled into the other API's docs. I'm not saying it's the best way, but it is what's going on. So if each of these sections are updated, and there are tons more in this state, we'll see very pythonic code examples in the R or Scala docs (not just these either). That could make things worse as opposed to these code examples being more of pseudo-code. |
@aaronmarkham Thanks for your review. Your point makes sense. In that case, we need to close this PR and start another PR that changes the examples in Pythonic way to pseudocode At the moment, there are few examples in Pythonic way, few in pseudo-code. We need to settle on one. |
I emailed the dev list about this issue yesterday. No response yet. I'm really not sure what the best way to proceed is.... I agree the examples should be executable, but things are complicated by how much is borrowed to support the docs for the other APIs. Let's see what dev@ says. |
@mxnet-label-bot add [pr-work-in-progress] |
@ChaiBapchya - here's Mu's response to my question though I'm not sure how it applies to this PR. |
src/operator/nn/concat.cc
Outdated
[ 5., 5.], | ||
[ 6., 6.], | ||
[ 7., 7.], | ||
[ 8., 8.]] |
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.
Have the community decided to remove all language-agnostic pseudo code example? Other language binding may loose the only available example
Let's take the So if we were to add the example in runnable python code, where would it go? |
@aaronmarkham it should go to https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/ndarray_doc.py |
Ok I asked Mu about that file on the dev list. I am beginning to understand, but I feel like there's a lot missing. Are you saying that 99% of the examples for ndarray do not exist because they're not in that file? |
I think it's just a way to append python specific examples |
@ChaiBapchya Can you address the review comments and rebase with the latest master branch ? |
@piyushghai I am still waiting for conclusive next steps. I am not sure if consensus was reached on dev list or the discussion here. Any idea how we can get clarity? Thanks. |
I am suggesting that python specific examples should be added to https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/ndarray_doc.py#L57 |
This reverts commit 48f926f.
@eric-haibin-lin Wanted to verify if the latest commit is correct? Also not sure if all the doc should go in this one file alone or some other separate file and is there any other file that needs to know to "refer to python/ndarray_doc? Just making sure I haven't missed it. Thanks. |
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.
Can you provide a preview link? I'm curious how this is looking and how to compare it to what's live now.
<NDArray 2x2 @cpu(0)> | ||
""" | ||
|
||
class ReshapeLikeDoc(NDArrayDoc): |
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.
How are you deciding when to capitalize?
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 was actually confused. Originally, there were 2 variants
Capitalized - StackDoc, BroadcastToDoc, ReshapeDoc
Non-capitalized - elemwise_addDoc
I am not sure if I understood the difference. Any help on those lines would be great. Thanks for pointing out.
@aaronmarkham I'm sorry I'm unaware. Can you tell me where I can find preview links for docs? Thanks. |
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 is a good start. Preview at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-14243/4/api/python/ndarray/ndarray.html#mxnet.ndarray.Concat
Restarted CI job (some MKL-DNN test failed, so let's see if it goes through this time...) |
<NDArray 1 @cpu(0)> | ||
""" | ||
|
||
class CastDoc(NDArrayDoc): |
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.
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.
Absolutely no idea why.
>>> y = mx.nd.array([[3,3],[4,4],[5,5]]) | ||
>>> z = mx.nd.array([[6,6], [7,7],[8,8]]) | ||
|
||
>>> mx.nd.concat(x,y,z,dim=0) |
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'm not seeing this show up in the preview...
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 do see it. Did you look at the right one?
The preview link is versioned, as mentioned in the pull request checklist:
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.
Why does the previous API render the interpreter prompt, but this one does not? It looks close, but I think they're different because it is missing these:
>>> y = mx.nd.array([[3,3],[4,4],[5,5]])
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.
Any idea why?
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.
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.
Ya, I guess he was looking at some other preview doc.
|
||
Return the elements, either from x or y, depending on the condition. | ||
|
||
>>> x = mx.nd.array([[1, 2], [3, 4]]) |
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 doesn't render right.
There are some rendering issues - likely just needs some extra line returns. Also, I think that because there are operators that use |
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.
Latest preview seems ok. http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-14243/10/api/python/index.html
@ChaiBapchya Thanks for your contribution! |
Since the launch of the new website, we don't depend on this file anymore. Hence closing this as stale PR |
Fixes #14232