Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes internal crash due to the invalid bufer size computation if sliced API is used
Not sure what was the purpose of
As flattenShaped could be much easier computed as
[srcBuf lengh]/src.element_size(), and even ifsrcBufis padded it's a safe thing to do.When someone allocated buffer to hold say uint8 and that view-casted it
to float16, attempt to compute
baseShapereturned sizes of originaltensor in its data type, rather than size in new dtypes
Fixes #137800