import tensorflow as tf

    """
    center = [(ss - 1) // 2 for ss in shape]
    axes = [tf.range(-cc, ss - cc, dtype=tf.int32) for cc, ss in zip(center, shape)]
    # Broadcast and match dimension.
    if len(shape) > 1:
        for jj in range(len(shape)):
            for ii in range(len(shape) + 1):
                if ii != jj:
                    axes[jj] = tf.expand_dims(axes[jj], ii)
        for jj in range(len(shape)):
            shape_ = [ss for ss in shape] + [1]
            shape_[jj] = 1
            axes[jj] = tf.tile(axes[jj], shape_)
        offset = tf.concat(axes, len(shape))
    return offset


def _get_offset_array(shape):
    """
    Computes the offset array used to upsample indices with NumPy (static).

    :param shape:   [list]     Window shape.
    """
    center = [int(ss - 1) // 2 for ss in shape]
