soiferj commented on a change in pull request #4308: [Frontend]Add TensorFlow 
FloorMod
URL: https://github.com/apache/incubator-tvm/pull/4308#discussion_r344983568
 
 

 ##########
 File path: tests/python/frontend/tensorflow/test_forward.py
 ##########
 @@ -1048,6 +1046,24 @@ def test_forward_divide():
     _test_forward_divide((4, 3, 7), 'float32')
     _test_forward_floordiv((4, 3, 7), 'float32')
 
+#######################################################################
+# FloorMod
+# --------
+def _test_forward_floormod(in_shape, if_shape, dtype):
+    np_numer = np.random.uniform(-100, 100, size=in_shape).astype(dtype)
+    np_factor = np.random.uniform(-100, 100, size=if_shape).astype(dtype)
+    tf.reset_default_graph()
+    numerator = tf.placeholder(dtype, in_shape, name="numer")
+    factor = tf.placeholder(dtype, if_shape, name="factor")
+    tf.math.floormod(numerator, factor, name='FloorMod')
+    compare_tf_with_tvm([np_numer, np_factor], ['numer:0', 'factor:0'], 
'FloorMod:0')
+
+def test_forward_floormod():
+    '''test FloorMod'''
+    _test_forward_floormod((10,), (10,), 'float32')
 
 Review comment:
   Can you also add a test with int? The TF documentation specifies that 
floormod can work with it too.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to