Commit 4a24413e authored by Yong Tang's avatar Yong Tang Committed by Rasmus Munk Larsen
Browse files

Validate axis in shape function of tf.reverse (#18024)



* Validate axis in shape function of tf.reverse

tf.reverse requires the axis to be in the range of
`[-rank(tensor), rank(tensor))`. Previously the validation
is only done in runtime though it is possible to validate
axis inside the shape function if the shape of the input tensor
is already known.

This fix add the validation in the shape function.

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Replace with temp variable

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Sanitize with clang-foramt -i

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Validate multiple specification of axis in tf.reverse as well

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Add test case for axis validation in shape function for tf.reverse

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Update existing test cases

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>
parent 7c06ae2f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment