import tensorflow as tf

    :param tol:          [float]    Lower bound of occupancy for creating a rectangle.

    :return          [tuple]
        bin_counts:           [Tensor]. Number of active locations for each bin.
        active_block_indices: [Tensor]. [M]. Center locations of M rectangles. Dtype int64.
    """

    def to_tensor(a, dtype):
        if type(a) == tf.Tensor:
            if a.dtype != dtype:
                return tf.cast(a, dtype)
            else:
                return a
        elif type(a) == list:
            if type(a[0]) == tf.Tensor:
                return tf.stack(a, 0)
            else:
                return tf.constant(a, dtype)
        else:
            print(type(a))
