def test_pool_average_3d(ndarray_1x1x4x4):
x = np.broadcast_to(ndarray_1x1x4x4, (1, 1, 4, 4, 4))
node = onnx.helper.make_node('AveragePool', inputs=['x'], outputs=['y'],
kernel_shape=(2, 2, 2), strides=(2, 2, 2))
y = np.array([[[13.5, 15.5],
[21.5, 23.5]],
[[13.5, 15.5],
[21.5, 23.5]]], dtype=np.float32).reshape(1, 1, 2, 2, 2)
ng_results = convert_and_calculate(node, [x], [y])
assert np.array_equal(ng_results, [y])
评论列表
文章目录