c18ea010c0f43c5144f1c5265874709f68c2e1f3,lazyflow/utility/blockwise_view.py,,blockwise_view,#Any#Any#Any#,3

Before Change


    blockshape = tuple(blockshape)

    // Pad leading dims with 1
    padded_dims = 5-a.ndim
    blockshape_5d = (1,) * padded_dims + blockshape
    a_5d = a[(None,)*padded_dims]

    view_10d = blockwise_view_5d( a_5d, blockshape_5d )
    
    // Drop the extra dimensions
    slicing_5d = (0,)*padded_dims + (slice(None),)*a.ndim
    slicing_10d = slicing_5d + slicing_5d
    
    view = view_10d[slicing_10d]
    assert view.shape == tuple(numpy.array(a.shape) / blockshape) + blockshape
    if require_aligned_blocks:
        assert view.size == a.size
    return view

After Change


    // inter_block_strides = a.itemsize * numpy.array([z*y*x*bt, y*x*bz, x*by, bx])

    // strides within each block
    intra_block_strides = [1]
    for s in a.shape[-1:0:-1]:
        intra_block_strides.append( s*intra_block_strides[-1] )
    intra_block_strides = numpy.array(intra_block_strides[::-1])
    
    // strides from one block to another
    inter_block_strides = numpy.array(intra_block_strides) * blockshape
    
    intra_block_strides *= a.itemsize
    inter_block_strides *= a.itemsize

    strides = tuple(inter_block_strides) + tuple(intra_block_strides)

    // This is where the magic happens.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 14

Instances


Project Name: ilastik/ilastik
Commit Name: c18ea010c0f43c5144f1c5265874709f68c2e1f3
Time: 2015-01-28
Author: bergs@janelia.hhmi.org
File Name: lazyflow/utility/blockwise_view.py
Class Name:
Method Name: blockwise_view


Project Name: pymc-devs/pymc3
Commit Name: fd76e96ce1a9718be1ae141c5f3cabddf48ca85f
Time: 2020-09-27
Author: dominik.otto@izi.fraunhofer.de
File Name: pymc3/distributions/transforms.py
Class Name: StickBreaking
Method Name: forward_val


Project Name: pymc-devs/pymc3
Commit Name: fd76e96ce1a9718be1ae141c5f3cabddf48ca85f
Time: 2020-09-27
Author: dominik.otto@izi.fraunhofer.de
File Name: pymc3/distributions/transforms.py
Class Name: StickBreaking
Method Name: forward