def METHOD_NAME(test_case):
    device = random_device()
    ndim = random(1, 6).to(int)
    x = random_tensor(ndim=ndim).to(device)
    y = torch.amax(x, dim=None, keepdim=random().to(bool))
    return y