cchung100m commented on a change in pull request #4271: [Relay][Frontend][ONNX] 
operator support: DepthToSpace, SpaceToDepth
URL: https://github.com/apache/incubator-tvm/pull/4271#discussion_r344206710
 
 

 ##########
 File path: tests/python/frontend/onnx/test_forward.py
 ##########
 @@ -142,6 +142,123 @@ def test_reshape():
     tvm.testing.assert_allclose(ref_shape, tvm_out.shape)
 
 
+def verify_depth_to_space(indata, outdata, mode="DCR"):
+    node = onnx.helper.make_node('DepthToSpace',
+                                 inputs=['x'],
+                                 outputs=['y'],
+                                 blocksize=2,
+                                 mode=mode)
+
+    graph = helper.make_graph([node],
+                              "depth_to_space_test",
+                              inputs=[helper.make_tensor_value_info("x", 
TensorProto.FLOAT, list(indata.shape))],
+                              outputs=[helper.make_tensor_value_info("y", 
TensorProto.FLOAT, list(outdata.shape))])
+    model = helper.make_model(graph, producer_name='depth_to_space_test')
+
+    for target, ctx in ctx_list():
+        tvm_out = get_tvm_output(model, [indata], target, ctx, outdata.shape, 
'float32')
+
+    tvm.testing.assert_allclose(outdata, tvm_out)
+
+
+def test_depth_to_space():
+    # CRD mode
+    # (1, 8, 2, 3) input tensor
+    x = np.array([[[[0., 1., 2.],
 
 Review comment:
   Hi @jwfromm 
   Thanks for the suggestion and I removed the hardcoded part.

----------------------------------------------------------------
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