def c2g(tensor, g):
    """
    Reshape from groups*channels to groups, channels
    """
    if g is None:
        return tensor
    b, gc, h, w = tensor.shape
    tensor = tensor.reshape(b, gc//g, g, h, w)
    return tensor