Commit a57a18dc authored by Yong Tang's avatar Yong Tang Committed by Martin Wicke
Browse files

Add int64 input tensor support for `tf.invert_permutation` (#14061)

* Add int64 input tensor support for `tf.invert_permutation`

This fix tries to add int64 input tensor support for `tf.invert_permutation`.
In the docs of the TensorFlow (https://www.tensorflow.org/api_docs/python/tf/invert_permutation

),
it was specified that the input tensor `x` could be either int32 or int64:
```
x: A Tensor. Must be one of the following types: int32, int64. 1-D.
```

However, int64 was actually not supported.

This fix adds the int64 support by adding template to the class `InvertPermutationOp`
so that both int64 and int32 could be processed.

This fix also adds additional test cases so that changes could be covered.

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

* Add test cases for int64 input tensor support of `tf.invert_permutation`

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

* Update test cases so that GPU test could be invoked.

Note: as CI/CI will invoke CPU and GPT tests individually,
no need to iterate through
```
for use_gpu in [True, False]:
```

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

* Add int64 input tensor support for `TENSORFLOW_USE_SYCL` of `invert_permutation` as well.

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

* Sanitize transpose_op.cc with `clang-format -i`

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