lhutton1 commented on a change in pull request #6248:
URL: https://github.com/apache/incubator-tvm/pull/6248#discussion_r469831401
##########
File path: tests/python/contrib/test_arm_compute_lib/test_pooling.py
##########
@@ -74,53 +142,133 @@ def test_pooling():
device = Device()
np.random.seed(0)
- for dtype, low, high, atol, rtol in [("float32", -127, 128, 0.001, 0.001),
("uint8", 0, 255, 0, 0)]:
- for size in [(2, 2), (3, 3)]:
- for stride in [(2, 2)]:
- shape = (1, size[0] + stride[0] * 5,
- size[1] + stride[1] * 5, 16)
- pad = (0, 0)
-
- inputs = {
- "a": tvm.nd.array(np.random.uniform(low, high,
shape).astype(dtype)),
- }
-
- outputs = []
- func = _get_model(shape, dtype, relay.nn.max_pool2d, size,
- stride, pad, True, iter(inputs))
- for acl in [False, True]:
- outputs.append(build_and_run(func, inputs, 1, None, device,
- enable_acl=acl)[0])
-
- params = {
- "size": size,
- "stride": stride,
- "shape": shape,
- "pooling type": "max",
- "dtype": dtype,
- "padding": pad
- }
- verify(outputs, atol=atol, rtol=rtol, params=params)
+ typef = ["nn.max_pool2d", "nn.avg_pool2d", "nn.l2_pool2d"]
+ dtype = [("float32", -127, 128, 0.001, 0.001), ("uint8", 0, 255, 1, 0)]
+ size = [(2, 2), (3, 3)]
+ stride = [(2, 2)]
+ pad = [(0, 0), (1, 1), (0, 1)]
+ ceil_mode = [False, True]
+ count_include_pad = [False, True]
+ input_shapes = [(8, 8, 16), (9, 9, 16)]
+ trials = generate_trials([typef, dtype, size, stride, pad, ceil_mode,
count_include_pad, input_shapes], 3)
Review comment:
Hmm maybe there was some misunderstanding here, I was simply trying to
align with the convolution tests. I think enumerating all possible combinations
and pruning invalid ones here would lead could lead to too many tests. For
example, pruning uint8 and l2 pooling, a combination of the above trials would
lead to 240 tests. I can simply list a series of trials although I think this
should be communicated across the rest of the tests including convolution.
----------------------------------------------------------------
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]