You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/02/24 03:02:33 UTC
[GitHub] [incubator-tvm] siju-samuel opened a new pull request #4926:
[TFLITE][FRONTEND]Reduce_any op parsing support
siju-samuel opened a new pull request #4926: [TFLITE][FRONTEND]Reduce_any op parsing support
URL: https://github.com/apache/incubator-tvm/pull/4926
@FrozenGene @u99127 @kevinthesun Please help to review. Thanks.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-tvm] inadob commented on a change in pull request #4926:
[TFLITE][FRONTEND]Reduce_any op parsing support
Posted by GitBox <gi...@apache.org>.
inadob commented on a change in pull request #4926: [TFLITE][FRONTEND]Reduce_any op parsing support
URL: https://github.com/apache/incubator-tvm/pull/4926#discussion_r387098200
##########
File path: tests/python/frontend/tflite/test_forward.py
##########
@@ -1152,6 +1165,8 @@ def test_all_reduce():
_test_forward_reduce_quantized(_test_reduce_mean)
_test_forward_reduce(_test_reduce_prod)
_test_forward_reduce(_test_reduce_sum)
+ if package_version.parse(tf.VERSION) >= package_version.parse('1.14.0'):
Review comment:
Support for boolean data type was added in tf 1.15 so, please, change the check
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-tvm] wyc-ruiker commented on a change in pull request
#4926: [TFLITE][FRONTEND]Reduce_any op parsing support
Posted by GitBox <gi...@apache.org>.
wyc-ruiker commented on a change in pull request #4926: [TFLITE][FRONTEND]Reduce_any op parsing support
URL: https://github.com/apache/incubator-tvm/pull/4926#discussion_r383114595
##########
File path: tests/python/frontend/tflite/test_forward.py
##########
@@ -1099,11 +1099,19 @@ def _test_reduce_sum(data, keep_dims=None):
""" One iteration of reduce_sum """
return _test_reduce(math_ops.reduce_sum, data, keep_dims)
+#######################################################################
+# Reduce_any
+# -----------
+
+def _test_reduce_any(data, keep_dims=None):
+ """ One iteration of reduce_any """
+ return _test_reduce(math_ops.reduce_any, data, keep_dims)
-def _test_forward_reduce(testop):
+
+def _test_forward_reduce(testop, dtype="float32"):
""" Reduce """
- data0 = [np.random.rand(16, 16, 16, 16).astype("float32"), None]
- data1 = [np.random.rand(16, 16, 16, 16).astype("float32"), np.array([1, 2], dtype=np.int32)]
+ data0 = [np.random.rand(16, 16, 16, 16).astype(dtype), None]
+ data1 = [np.random.rand(16, 16, 16, 16).astype(dtype), np.array([1, 2], dtype=np.int32)]
Review comment:
I'm a little confused. I think the elements of `np.random.rand().astype("bool")` will be `True` in most cases.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-tvm] FrozenGene commented on issue #4926:
[TFLITE][FRONTEND]Reduce_any op parsing support
Posted by GitBox <gi...@apache.org>.
FrozenGene commented on issue #4926: [TFLITE][FRONTEND]Reduce_any op parsing support
URL: https://github.com/apache/incubator-tvm/pull/4926#issuecomment-598039651
Thanks @siju-samuel @inadob @wyc-ruiker merged
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-tvm] inadob commented on a change in pull request #4926:
[TFLITE][FRONTEND]Reduce_any op parsing support
Posted by GitBox <gi...@apache.org>.
inadob commented on a change in pull request #4926: [TFLITE][FRONTEND]Reduce_any op parsing support
URL: https://github.com/apache/incubator-tvm/pull/4926#discussion_r384635788
##########
File path: tests/python/frontend/tflite/test_forward.py
##########
@@ -1099,11 +1099,22 @@ def _test_reduce_sum(data, keep_dims=None):
""" One iteration of reduce_sum """
return _test_reduce(math_ops.reduce_sum, data, keep_dims)
+#######################################################################
+# Reduce_any
+# -----------
+
+def _test_reduce_any(data, keep_dims=None):
+ """ One iteration of reduce_any """
+ return _test_reduce(math_ops.reduce_any, data, keep_dims)
-def _test_forward_reduce(testop):
+
+def _test_forward_reduce(testop, dtype=None):
""" Reduce """
data0 = [np.random.rand(16, 16, 16, 16).astype("float32"), None]
data1 = [np.random.rand(16, 16, 16, 16).astype("float32"), np.array([1, 2], dtype=np.int32)]
+ if dtype == 'bool':
+ data0[0] = (data0[0] < 0.5).astype(dtype)
+ data1[0] = (data1[0] < 0.5).astype(dtype)
Review comment:
To generate boolean numpy data you can use
`data = np.random.choice(a=[False, True], size=(1, 2, 3)).astype('bool')`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-tvm] inadob commented on issue #4926:
[TFLITE][FRONTEND]Reduce_any op parsing support
Posted by GitBox <gi...@apache.org>.
inadob commented on issue #4926: [TFLITE][FRONTEND]Reduce_any op parsing support
URL: https://github.com/apache/incubator-tvm/pull/4926#issuecomment-594419573
LGTM
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-tvm] wyc-ruiker commented on a change in pull request
#4926: [TFLITE][FRONTEND]Reduce_any op parsing support
Posted by GitBox <gi...@apache.org>.
wyc-ruiker commented on a change in pull request #4926: [TFLITE][FRONTEND]Reduce_any op parsing support
URL: https://github.com/apache/incubator-tvm/pull/4926#discussion_r383382241
##########
File path: tests/python/frontend/tflite/test_forward.py
##########
@@ -1099,11 +1099,22 @@ def _test_reduce_sum(data, keep_dims=None):
""" One iteration of reduce_sum """
return _test_reduce(math_ops.reduce_sum, data, keep_dims)
+#######################################################################
+# Reduce_any
+# -----------
+
+def _test_reduce_any(data, keep_dims=None):
+ """ One iteration of reduce_any """
+ return _test_reduce(math_ops.reduce_any, data, keep_dims)
-def _test_forward_reduce(testop):
+
Review comment:
unnecessary line feed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-tvm] FrozenGene merged pull request #4926:
[TFLITE][FRONTEND]Reduce_any op parsing support
Posted by GitBox <gi...@apache.org>.
FrozenGene merged pull request #4926: [TFLITE][FRONTEND]Reduce_any op parsing support
URL: https://github.com/apache/incubator-tvm/pull/4926
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-tvm] wyc-ruiker commented on a change in pull request
#4926: [TFLITE][FRONTEND]Reduce_any op parsing support
Posted by GitBox <gi...@apache.org>.
wyc-ruiker commented on a change in pull request #4926: [TFLITE][FRONTEND]Reduce_any op parsing support
URL: https://github.com/apache/incubator-tvm/pull/4926#discussion_r383383125
##########
File path: tests/python/frontend/tflite/test_forward.py
##########
@@ -1099,11 +1099,22 @@ def _test_reduce_sum(data, keep_dims=None):
""" One iteration of reduce_sum """
return _test_reduce(math_ops.reduce_sum, data, keep_dims)
+#######################################################################
+# Reduce_any
+# -----------
+
+def _test_reduce_any(data, keep_dims=None):
+ """ One iteration of reduce_any """
+ return _test_reduce(math_ops.reduce_any, data, keep_dims)
-def _test_forward_reduce(testop):
+
+def _test_forward_reduce(testop, dtype=None):
""" Reduce """
data0 = [np.random.rand(16, 16, 16, 16).astype("float32"), None]
data1 = [np.random.rand(16, 16, 16, 16).astype("float32"), np.array([1, 2], dtype=np.int32)]
+ if dtype == 'bool':
+ data0[0] = (data0[0] < 0.5).astype(dtype)
+ data1[0] = (data1[0] < 0.5).astype(dtype)
Review comment:
It seems a little strange. Wait for other review's opinions.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-tvm] wyc-ruiker commented on a change in pull request
#4926: [TFLITE][FRONTEND]Reduce_any op parsing support
Posted by GitBox <gi...@apache.org>.
wyc-ruiker commented on a change in pull request #4926: [TFLITE][FRONTEND]Reduce_any op parsing support
URL: https://github.com/apache/incubator-tvm/pull/4926#discussion_r383114595
##########
File path: tests/python/frontend/tflite/test_forward.py
##########
@@ -1099,11 +1099,19 @@ def _test_reduce_sum(data, keep_dims=None):
""" One iteration of reduce_sum """
return _test_reduce(math_ops.reduce_sum, data, keep_dims)
+#######################################################################
+# Reduce_any
+# -----------
+
+def _test_reduce_any(data, keep_dims=None):
+ """ One iteration of reduce_any """
+ return _test_reduce(math_ops.reduce_any, data, keep_dims)
-def _test_forward_reduce(testop):
+
+def _test_forward_reduce(testop, dtype="float32"):
""" Reduce """
- data0 = [np.random.rand(16, 16, 16, 16).astype("float32"), None]
- data1 = [np.random.rand(16, 16, 16, 16).astype("float32"), np.array([1, 2], dtype=np.int32)]
+ data0 = [np.random.rand(16, 16, 16, 16).astype(dtype), None]
+ data1 = [np.random.rand(16, 16, 16, 16).astype(dtype), np.array([1, 2], dtype=np.int32)]
Review comment:
I'm a little confused. I think the elements of `np.random.rand().astype("bool")` will be 1 in most cases.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-tvm] inadob commented on a change in pull request #4926:
[TFLITE][FRONTEND]Reduce_any op parsing support
Posted by GitBox <gi...@apache.org>.
inadob commented on a change in pull request #4926: [TFLITE][FRONTEND]Reduce_any op parsing support
URL: https://github.com/apache/incubator-tvm/pull/4926#discussion_r384635788
##########
File path: tests/python/frontend/tflite/test_forward.py
##########
@@ -1099,11 +1099,22 @@ def _test_reduce_sum(data, keep_dims=None):
""" One iteration of reduce_sum """
return _test_reduce(math_ops.reduce_sum, data, keep_dims)
+#######################################################################
+# Reduce_any
+# -----------
+
+def _test_reduce_any(data, keep_dims=None):
+ """ One iteration of reduce_any """
+ return _test_reduce(math_ops.reduce_any, data, keep_dims)
-def _test_forward_reduce(testop):
+
+def _test_forward_reduce(testop, dtype=None):
""" Reduce """
data0 = [np.random.rand(16, 16, 16, 16).astype("float32"), None]
data1 = [np.random.rand(16, 16, 16, 16).astype("float32"), np.array([1, 2], dtype=np.int32)]
+ if dtype == 'bool':
+ data0[0] = (data0[0] < 0.5).astype(dtype)
+ data1[0] = (data1[0] < 0.5).astype(dtype)
Review comment:
To generate boolean numpy boolean data you can use
`data = np.random.choice(a=[False, True], size=(1, 2, 3)).astype('bool')`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services