chengven027-intellif opened a new issue, #13020:
URL: https://github.com/apache/tvm/issues/13020

   Hi, TVM.
   When I test `resize2d` test case, I got a error.
   The test case is modify in onnx/test_forward.py.
   ```
   @tvm.testing.parametrize_targets
   def test_resize(target, dev):
       """test_resize"""
   
       def verify(ishape, oshape, scales, mode, coord_trans="asymmetric", 
alpha=0.5, exclude=False):
           nodes = [
               make_constant_node("roi", onnx.TensorProto.FLOAT, (0,), []),
               make_constant_node("scales", onnx.TensorProto.FLOAT, 
(len(scales),), scales),
           ]
           input_names = ["X", "roi", "scales"]
   
           if oshape != []:
               nodes.append(
                   make_constant_node("sizes", onnx.TensorProto.INT64, 
(len(oshape),), oshape)
               )
               input_names.append("sizes")
           nodes.append(
               helper.make_node(
                   "Resize",
                   inputs=input_names,
                   outputs=["Y"],
                   mode=mode,
                   coordinate_transformation_mode=coord_trans,
                   cubic_coeff_a=alpha,
                   exclude_outside=exclude,
                   nearest_mode="round_prefer_ceil",
               )
           )
   
           if oshape == []:
               oshape = [round(dim * scale) for (dim, scale) in zip(ishape, 
scales)]
           graph = helper.make_graph(
               nodes,
               "resize_test",
               inputs=[helper.make_tensor_value_info("X", TensorProto.FLOAT, 
ishape)],
               outputs=[helper.make_tensor_value_info("Y", TensorProto.FLOAT, 
oshape)],
           )
   
           model = helper.make_model(graph, producer_name="resize_test")
   
           verify_with_ort(
               model,
               [ishape],
               [oshape],
               use_vm=True,
               opset=11,
               freeze_params=True,
               target=target,
               dev=dev,
           )
       verify([1, 3, 320, 320], [1, 3, 96, 96], [] , "nearest", "half_pixel")
   ```
   Just add a attr of  `nearest_mode == round_prefer_ceil `   and use a 
downsampling test case.
   then I got a error result.
   ```
   ...
   AssertionError: 
   Not equal to tolerance rtol=1e-05, atol=1e-05
   
   Mismatched elements: 6981 / 27648 (25.2%)
   Max absolute difference: 0.9944779
   Max relative difference: 1944.2539
    x: array([[[[0.760807, 0.360286, 0.685025, ..., 0.462795, 0.444001,
             0.811332],
            [0.871344, 0.584723, 0.636383, ..., 0.738846, 0.113738,...
    y: array([[[[0.760807, 0.360286, 0.685025, ..., 0.462795, 0.444001,
             0.811332],
            [0.871344, 0.584723, 0.636383, ..., 0.738846, 0.113738,...
   ```
   
   ### Expected behavior
   
   The result is correct
   
   ### Actual behavior
   
   The result is not correct
   
   ### Environment
   
   the tvm version is latest
   
   @AndrewZhaoLuo @masahi Can you help me to have a look this question. 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to