

def _broadcast(self, schedule, params, retval):
    assert (schedule.loopn > 0), 'zero looping dimension'
    odim = (1 if (not schedule.loopdims) else schedule.loopn)
    newparams = []
    for (p, cs) in zip(params, schedule.ishapes):
        if ((not cs) and (p.size == 1)):
            devary = self._broadcast_scalar_input(p, odim)
            newparams.append(devary)
        else:
            newparams.append(self._broadcast_array(p, odim, cs))
    newretval = retval.reshape(odim, *schedule.oshapes[0])
    return (newparams, newretval)

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