Skip to content

Support non-default negative axis value and intuitive data type combination for OneHot op - #1317

Merged
Hariharan Seshadri (hariharans29) merged 2 commits into
masterfrom
OneHotChanges
Jul 1, 2019
Merged

Support non-default negative axis value and intuitive data type combination for OneHot op#1317
Hariharan Seshadri (hariharans29) merged 2 commits into
masterfrom
OneHotChanges

Conversation

@hariharans29

@hariharans29 Hariharan Seshadri (hariharans29) commented Jun 29, 2019

Copy link
Copy Markdown
Member

Description:
This change tries to resolve 2 open issues regarding the OneHot operator:

#1313 : Treat (non-default) negative axis value like how any other ONNX operator does
#1314 : Support a more intuitive data type combination for this operator

Motivation and Context
Resolve #1313 and #1314

@hariharans29

Copy link
Copy Markdown
Member Author

CC: Dwayne Robinson (@fdwr)

@pranavsharma

Copy link
Copy Markdown
Contributor

Is this behavior documented in the spec? If not, can you document it?

@hariharans29

Hariharan Seshadri (hariharans29) commented Jul 1, 2019

Copy link
Copy Markdown
Member Author

Is this behavior documented in the spec? If not, can you document it?

This a good suggestion.

But this behavior is implicitly understood and expected of all ONNX ops that have an axis attribute/input. In fact, there are quite a few ONNX ops where this behavior is not explicitly stated but is handled anyway. For example, ArgMax, ArgMIn (to name a couple) have a similar expectation but have no such behavior explicitly documented. ONNXRuntime handles negative axis wherever an axis input is provided.

It might be worthwhile to state this just once somewhere in ONNX as opposed to adding one line for this op (and every other op that's missing the behavior explicitly)

@hariharans29
Hariharan Seshadri (hariharans29) deleted the OneHotChanges branch July 1, 2019 21:29
Hariharan Seshadri (hariharans29) added a commit that referenced this pull request Aug 29, 2019
…nation for OneHot op (#1317)

* Handle nondefault negative axis value

* Support more intuitive data types for this op
Hariharan Seshadri (hariharans29) added a commit that referenced this pull request Sep 4, 2019
…nation for OneHot op (#1317) (#1732)

* Handle nondefault negative axis value

* Support more intuitive data types for this op
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OneHot should treat negative axis as range from last dimension

2 participants