def make_tensor_5d(t):
    """Extends a tensor or numpy array to have exactly 5 dimensions.
    
    In doing so, it interprets 1d tensors as being aligned
    in time, 2d tensors to be aligned in space, etc.

        - 1d: t[None,None,:,None,None]
        - 2d: t[None,None,None,:,:]
        - 3d: t[None,None,:,:,:]
        - 4d: t[None,:,:,:,:]
        - 5d: t
        - 6d and more: selects the first element of t until t has 5 dimensions

    """
    if type(t.shape) is tuple:
        if len(t.shape) > 5:
            while len(t.shape) > 5:
                t = t[0]
        if len(t.shape) == 4:
            t = t[None]
        if len(t.shape) == 3:
            t = t[None, None]
        if len(t.shape) == 2:
            t = t[None, None, None]
        if len(t.shape) == 1:
            t = t[(None), (None), :, (None), (None)]
        return t
    else:
        if len(t.size()) > 5:
            while len(t.shape) > 5:
                t = t[0]
        if len(t.size()) == 4:
            t = t[None]
        if len(t.size()) == 3:
            t = t[None, None]
        if len(t.size()) == 2:
            t = t[None, None, None]
        if len(t.size()) == 1:
            t = t[(None), (None), :, (None), (None)]
        return t
