import tensorflow as tf

    axes = [np.arange(-cc, int(ss) - cc).astype(np.int32) for cc, ss in zip(center, shape)]
    if len(shape) > 1:
        for jj in range(len(shape)):
            for ii in range(len(shape) + 1):
                if ii != jj:
                    axes[jj] = np.expand_dims(axes[jj], ii)
        for jj in range(len(shape)):
            shape_ = [int(ss) for ss in shape] + [1]
            shape_[jj] = 1
            axes[jj] = np.tile(axes[jj], shape_)
        offset = np.concatenate(axes, len(shape))
        return tf.constant(offset)
    else:
        return tf.constant(axes[0])


def _calc_block_strides(bsize, ksize, strides):
    """Calculates strides for blocks.

    :param bsize:     [list]        List of 4 int. Size of blocks, or downsample ratio.
    :param ksize:     [list]        List of 4 int. Sparse convolution kernel size.
    :param strides:   [list]        List of 4 int. Sparse convolution strides.
