GlobalLpPool#
Domain:
ai.onnxSince version: 22
GlobalLpPool consumes an input tensor X and applies lp pool pooling across the values in the same channel. This is equivalent to LpPool with kernel size equal to the spatial dimension of input tensor.
Inputs
X (T): Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 … Dn), where N is the batch size.
Outputs
Y (T): Output data tensor from pooling across the input tensor. The output tensor has the same rank as the input. The first two dimensions of output shape are the same as the input (N x C), while the other dimensions are all 1.
Type Constraints
T: Constrain input and output types to float tensors. Allowed types: tensor(bfloat16), tensor(double), tensor(float), tensor(float16).
Examples#
test_cc_globallppool_default
Node:
GlobalLpPool(x) -> (y)
Inputs:
x: shape=(1, 1, 3, 3), dtype=float32
[[[[1., 2., 3.],
[4., 5., 6.],
[7., 8., 9.]]]]
Outputs:
y: shape=(1, 1, 1, 1), dtype=float32
[[[[16.881943]]]]
test_cc_globallppool_lp1
Node:
GlobalLpPool(x) -> (y)
Attributes:
p = 1
Inputs:
x: shape=(1, 3, 5, 5), dtype=float32
[[[[ 1., 2., 3., 4., 5.],
[ 6., 7., 8., 9., 10.],
[11., 12., 13., 14., 15.],
[16., 17., 18., 19., 20.],
[21., 22., 23., 24., 25.]],
[[26., 27., 28., 29., 30.],
[31., 32., 33., 34., 35.],
[36., 37., 38., 39., 40.],
[41., 42., 43., 44., 45.],
[46., 47., 48., 49., 50.]],
[[51., 52., 53., 54., 55.],
[56., 57., 58., 59., 60.],
[61., 62., 63., 64., 65.],
[66., 67., 68., 69., 70.],
[71., 72., 73., 74., 75.]]]]
Outputs:
y: shape=(1, 3, 1, 1), dtype=float32
[[[[ 325.]],
[[ 950.]],
[[1575.]]]]
test_cc_globallppool_lp2
Node:
GlobalLpPool(x) -> (y)
Attributes:
p = 2
Inputs:
x: shape=(1, 3, 5, 5), dtype=float32
[[[[ 1., 2., 3., 4., 5.],
[ 6., 7., 8., 9., 10.],
[11., 12., 13., 14., 15.],
[16., 17., 18., 19., 20.],
[21., 22., 23., 24., 25.]],
[[26., 27., 28., 29., 30.],
[31., 32., 33., 34., 35.],
[36., 37., 38., 39., 40.],
[41., 42., 43., 44., 45.],
[46., 47., 48., 49., 50.]],
[[51., 52., 53., 54., 55.],
[56., 57., 58., 59., 60.],
[61., 62., 63., 64., 65.],
[66., 67., 68., 69., 70.],
[71., 72., 73., 74., 75.]]]]
Outputs:
y: shape=(1, 3, 1, 1), dtype=float32
[[[[ 74.330345]],
[[193.3908 ]],
[[317.05676 ]]]]
Differences with previous version (2)#
SchemaDiff: GlobalLpPool (domain 'ai.onnx')
old version: 2
new version: 22
breaking: no
Type constraints:
changed ‘T’: added types: [‘tensor(bfloat16)’]