import torch


def size_getter(shape):
    """
    Helper function for defining a size object.
    :param shape: The shape
    :type shape: int|tuple[int]
    :return: Size object
    :rtype: torch.Size
    """

    return torch.Size([]) if shape is None else torch.Size(shape if isinstance(shape, (tuple, list)) else (shape,))