

def _broadcast_array(self, ary, newdim, innerdim):
    newshape = ((newdim,) + innerdim)
    if (ary.shape == newshape):
        return ary
    elif (len(ary.shape) < len(newshape)):
        assert (newshape[(- len(ary.shape)):] == ary.shape), 'cannot add dim and reshape at the same time'
        return self._broadcast_add_axis(ary, newshape)
    else:
        return ary.reshape(*newshape)

dataset/ETHPy150Open numba/numba/numba/npyufunc/deviceufunc.py GenerializedUFunc._broadcast_array/original