(accum, x, y, batch_size)
return accum
Break up very large adbmm operations into batches so progress can be seen.
Break up very large adbmm operations into batches so progress can be seen.
Break up very large adbmm operations into batches so progress can be seen .
def progress_addbmm(accum, x, y, batch_size):
    '''
    Break up very large adbmm operations into batches so progress can be seen.
    '''
    from . import pbar
    if x.shape[0] <= batch_size:
        return accum.addbmm_(x, y)
    for i in pbar(range(0, x.shape[0], batch_size), desc='bmm'):
        accum.addbmm_(x[i:i+batch_size], y[i:i+batch_size])
    return accum
def progress_addbmm ( accum , x , y , batch_size ) : from . import pbar if x . shape [ 0 ] <= batch_size : return accum . addbmm_ ( x , y ) for i in pbar ( range ( 0 , x . shape [ 0 ] , batch_size ) , desc = 'bmm' ) : accum . addbmm_ ( x [ i : i + batch_size ] , y [ i : i + batch_size ] ) return accum