import torch


def GlobalAvgPooling(x):
    """
    Input: (batch, channels, height, weight)
    Output: mean, (batch, channels)
    """
    b, c, h, w = x.shape
    x = x.view(b, c, h*w)
    mean = torch.mean(x, dim=2)

    return mean