You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/08/13 11:05:24 UTC

[GitHub] sbodenstein commented on a change in pull request #12035: Pad Operator Type Support

sbodenstein commented on a change in pull request #12035: Pad Operator Type Support
URL: https://github.com/apache/incubator-mxnet/pull/12035#discussion_r209569552
 
 

 ##########
 File path: tests/python/unittest/test_operator.py
 ##########
 @@ -2905,37 +2905,46 @@ def test_roipooling():
                            numeric_eps=1e-4, rtol=1e-1, atol=1E-4)
 
 
-def check_pad_with_shape(shape, xpu, pad_width, mode):
+def check_pad_with_shape(shape, xpu, pad_width, mode, dtype="float64"):
     # bind with label
-    X = mx.symbol.Variable('X')
+    real_types = ["float16", "float32", "float64"]
+    X = mx.symbol.Variable('X', dtype=dtype)
     Y = mx.symbol.Pad(data=X, mode=mode, pad_width=pad_width)
-    x = mx.random.uniform(-1, 1, shape, ctx=mx.cpu()).copyto(xpu)
+    if dtype in real_types:
+        x = mx.random.uniform(-1, 1, shape, ctx=mx.cpu(), dtype=dtype).copyto(xpu)
 
 Review comment:
   Its not looping over `real_types` and its not overriding anything (`X` and `x` are different). This is simply written to be compatible with the integer case one day (happy to remove for now if you want). Unless I'm misunderstanding something?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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