AdaptiveAvgPool2d

class dragon.vm.torch.nn.AdaptiveAvgPool2d(output_size)[source]

Apply the 2d adaptive average pooling.

This module excepts the input size \((N, C, H, W)\), and output size is \((N, C, H_{\text{out}}, W_{\text{out}})\), where \(N\) is the batch size, \(C\) is the number of channels, \(H\) and \(W\) are the height and width of data.

Examples:

m = torch.nn.AdaptiveAvgPool2d(1)
x = torch.ones(2, 2, 2, 2)
y = m(x)

__init__

AdaptiveAvgPool2d.__init__(output_size)[source]

Create a AdaptiveAvgPool2d module.

Parameters:
  • output_size (Union[int, Sequence[int]]) – The target output size.