def atleast(arr, ndim=4):
    while arr.ndim < ndim:
        arr = arr[np.newaxis,...]
    return arr
Increase number of dimensions by adding singleton dimensions.
dataset/ETHPy150Open bbabenko/simple_convnet/simple_convnet/helpers.py/atleast