def test_pool_global_average_3d(ndarray_1x1x4x4):
x = np.broadcast_to(ndarray_1x1x4x4, (1, 1, 4, 4, 4))
node = onnx.helper.make_node('GlobalAveragePool', inputs=['x'], outputs=['y'])
y = np.array([18.5], dtype=np.float32).reshape(1, 1, 1, 1, 1)
ng_results = convert_and_calculate(node, [x], [y])
assert np.array_equal(ng_results, [y])
评论列表
文章目录