Support GatherND operator in ONNX#2106
Conversation
|
TF's gather-nd seems to have an extra batch_dims attribute for batched gather-nd … is that required or useful? |
houseroad
left a comment
There was a problem hiding this comment.
Also could you provide some brief summary about the PR in the PR's description?
Well sure - but the description is same as the title - to support GatherND op in ONNX. Do you mean you want a justification to include this by any chance ? |
Not sure about this - let me take a look. Thanks! |
@gramalingam - I took a look at the |
|
I personally think it is okay to leave it for future extension if we don't see a use-case for it. |
I think this is a good idea too. We can always version the op later. |
|
@hariharans29 - Overall, this looks OK. I don't have any specific blocking issues on this. Could you please take a look at the recently approved guideline document for adding new ops and update (if needed) based on that.
|
wschin
left a comment
There was a problem hiding this comment.
LGTM. Just one suspicious typo.
|
|
||
| The output is computed as follows: | ||
|
|
||
| The output tensor can be thought of as filling in the `indices` tensor with the appropriate slices of the input `data`. |
There was a problem hiding this comment.
Change to "The output tensor is obtained by mapping each index-tuple in the indices tensor to the corresponding slice of the input data"
|
Let me also add - This operator is the inverse of ScatterND ,since ScatterND has a similar line in it |
|
By the way: there was a discussion about supporting negative indices in Gather (since pytorch supports that). Do we want to extend this to allow negative indices? |
This is a good question - in this spec version, I explicitly did not allow it and pretty much followed the spec clarification in |
|
Spoke offline to @spandantiwari and @BowenBao - We will support negative indexing in this op after a consensus on it is reached and we will add negative indexing support in a more streamlined manner across similar ops. For now, it makes sense to stay consistent with |
This change is to support GatherND operator in ONNX.