[TFLite] Strided slice handling of shrink_axis_mask improved#6998
Merged
FrozenGene merged 2 commits intoapache:mainfrom Jan 21, 2021
Merged
[TFLite] Strided slice handling of shrink_axis_mask improved#6998FrozenGene merged 2 commits intoapache:mainfrom
FrozenGene merged 2 commits intoapache:mainfrom
Conversation
1. Added removal of dimensions if result is a scalar
to mimic TensorFlow behaviour. E.g.:
tf.strided_slice([1,2,3], [0], [1], [1], shrink_axis_mask=0)
<tf.Tensor: shape=(1,), dtype=int32, numpy=array([1], dtype=int32)>
tf.strided_slice([[[1,2,3],[4,5,6],[7,8,9]]], [0, 0, 0], [3, 3, 3], [1, 1, 1], shrink_axis_mask=7)
<tf.Tensor: shape=(), dtype=int32, numpy=1>
2. Added extra check to assert_allclose to check shape equalities
as np.testing.assert_allclose() does not distinguish between cases like:
np.testing.assert_allclose(1, np.array(1))
np.testing.assert_allclose(1, np.array([1]))
np.testing.assert_allclose(np.array(1), np.array([1]))
Contributor
Author
|
Ping. How can we make some progress here? |
Contributor
I'm not familiar with TFLite frontend. cc @siju-samuel @FrozenGene |
Contributor
Author
|
bump cc @siju-samuel @FrozenGene |
Contributor
Author
|
How can we make a progress here? |
Member
|
@d-smirnov I will review it today, thanks! |
FrozenGene
approved these changes
Jan 16, 2021
Member
|
please fix ci problem |
FrozenGene
reviewed
Jan 20, 2021
alexwong
pushed a commit
to alexwong/tvm
that referenced
this pull request
Feb 11, 2021
…6998) * [TFLite] Strided slice handlig of shrink_axis_mask improved 1. Added removal of dimensions if result is a scalar to mimic TensorFlow behaviour. E.g.: tf.strided_slice([1,2,3], [0], [1], [1], shrink_axis_mask=0) <tf.Tensor: shape=(1,), dtype=int32, numpy=array([1], dtype=int32)> tf.strided_slice([[[1,2,3],[4,5,6],[7,8,9]]], [0, 0, 0], [3, 3, 3], [1, 1, 1], shrink_axis_mask=7) <tf.Tensor: shape=(), dtype=int32, numpy=1> 2. Added extra check to assert_allclose to check shape equalities as np.testing.assert_allclose() does not distinguish between cases like: np.testing.assert_allclose(1, np.array(1)) np.testing.assert_allclose(1, np.array([1])) np.testing.assert_allclose(np.array(1), np.array([1])) * unit tests fixed
electriclilies
pushed a commit
to electriclilies/tvm
that referenced
this pull request
Feb 18, 2021
…6998) * [TFLite] Strided slice handlig of shrink_axis_mask improved 1. Added removal of dimensions if result is a scalar to mimic TensorFlow behaviour. E.g.: tf.strided_slice([1,2,3], [0], [1], [1], shrink_axis_mask=0) <tf.Tensor: shape=(1,), dtype=int32, numpy=array([1], dtype=int32)> tf.strided_slice([[[1,2,3],[4,5,6],[7,8,9]]], [0, 0, 0], [3, 3, 3], [1, 1, 1], shrink_axis_mask=7) <tf.Tensor: shape=(), dtype=int32, numpy=1> 2. Added extra check to assert_allclose to check shape equalities as np.testing.assert_allclose() does not distinguish between cases like: np.testing.assert_allclose(1, np.array(1)) np.testing.assert_allclose(1, np.array([1])) np.testing.assert_allclose(np.array(1), np.array([1])) * unit tests fixed
Lokiiiiii
pushed a commit
to Lokiiiiii/tvm
that referenced
this pull request
Mar 2, 2021
…6998) * [TFLite] Strided slice handlig of shrink_axis_mask improved 1. Added removal of dimensions if result is a scalar to mimic TensorFlow behaviour. E.g.: tf.strided_slice([1,2,3], [0], [1], [1], shrink_axis_mask=0) <tf.Tensor: shape=(1,), dtype=int32, numpy=array([1], dtype=int32)> tf.strided_slice([[[1,2,3],[4,5,6],[7,8,9]]], [0, 0, 0], [3, 3, 3], [1, 1, 1], shrink_axis_mask=7) <tf.Tensor: shape=(), dtype=int32, numpy=1> 2. Added extra check to assert_allclose to check shape equalities as np.testing.assert_allclose() does not distinguish between cases like: np.testing.assert_allclose(1, np.array(1)) np.testing.assert_allclose(1, np.array([1])) np.testing.assert_allclose(np.array(1), np.array([1])) * unit tests fixed
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
Mar 2, 2021
…6998) * [TFLite] Strided slice handlig of shrink_axis_mask improved 1. Added removal of dimensions if result is a scalar to mimic TensorFlow behaviour. E.g.: tf.strided_slice([1,2,3], [0], [1], [1], shrink_axis_mask=0) <tf.Tensor: shape=(1,), dtype=int32, numpy=array([1], dtype=int32)> tf.strided_slice([[[1,2,3],[4,5,6],[7,8,9]]], [0, 0, 0], [3, 3, 3], [1, 1, 1], shrink_axis_mask=7) <tf.Tensor: shape=(), dtype=int32, numpy=1> 2. Added extra check to assert_allclose to check shape equalities as np.testing.assert_allclose() does not distinguish between cases like: np.testing.assert_allclose(1, np.array(1)) np.testing.assert_allclose(1, np.array([1])) np.testing.assert_allclose(np.array(1), np.array([1])) * unit tests fixed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added removal of dimensions if result is a scalar
to mimic TensorFlow behaviour. E.g.:
tf.strided_slice([1,2,3], [0], [1], [1], shrink_axis_mask=0)
<tf.Tensor: shape=(1,), dtype=int32, numpy=array([1], dtype=int32)>
tf.strided_slice([[[1,2,3],[4,5,6],[7,8,9]]], [0, 0, 0], [3, 3, 3], [1, 1, 1], shrink_axis_mask=7)
<tf.Tensor: shape=(), dtype=int32, numpy=1>
Added extra check to assert_allclose to check shape equalities
as np.testing.assert_allclose() does not distinguish between cases like:
np.testing.assert_allclose(1, np.array(1))
np.testing.assert_allclose(1, np.array([1]))
np.testing.assert_allclose(np.array(1), np.array([1]))