Skip to content

Conversation

@s22chan
Copy link

@s22chan s22chan commented Oct 3, 2024

tf.slice does not act like tf.get_item (eg, python)

from
https://www.tensorflow.org/api_docs/python/tf/slice

If size[i] is -1, all remaining elements in dimension i are included in the slice. In other words, this is equivalent to setting:

size[i] = input_.dim_size(i) - begin[i]

this likely fixes the bfloat optimizations size issues in the TPU Inference Converter as well.

tf.slice does not act like tf.get_item (eg, python)

from 
https://www.tensorflow.org/api_docs/python/tf/slice

> If size[i] is -1, all remaining elements in dimension i are included in the slice. In other words, this is equivalent to setting:

`size[i] = input_.dim_size(i) - begin[i]`

this likely fixes the bfloat optimizations size issues in the TPU Inference Converter as well.
@shaobohou
Copy link
Collaborator

I think this is still not quite right, do you mind if I merge this one instead #220

@s22chan
Copy link
Author

s22chan commented Oct 4, 2024

I don't see any difference other than formatting, but feel free to merge any fix. fyi:

>>> (1+0) if True else 2
1
>>> 1+0 if True else 2
1

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.

2 participants