GlobalAvgPool2D

class GlobalAvgPool2D(layout='NCHW', **kwargs)

Global average pooling operation for spatial data.

Parameters:
layout : str, default ‘NCHW’

Dimension ordering of data and out (‘NCHW’ or ‘NHWC’). ‘N’, ‘C’, ‘H’, ‘W’ stands for batch, channel, height, and width dimensions respectively.

Inputs:
  • data: 4D input tensor with shape (batch_size, in_channels, height, width) when layout is NCHW. For other layouts shape is permuted accordingly.
Outputs:
  • out: 4D output tensor with shape (batch_size, channels, 1, 1) when layout is NCHW.