def test_compute_floor_offsets_with_indices_and_targets(self):

    def graph_fn():
        y_source = tf.constant([1.5, 0.3], dtype=tf.float32)
        x_source = tf.constant([2.5, 4.2], dtype=tf.float32)
        y_target = tf.constant([2.1, 0.1], dtype=tf.float32)
        x_target = tf.constant([1.2, 4.5], dtype=tf.float32)
        (offsets, indices) = ta_utils.compute_floor_offsets_with_indices(y_source, x_source, y_target, x_target)
        return (offsets, indices)
    (offsets, indices) = self.execute(graph_fn, [])
    np.testing.assert_array_almost_equal(offsets, np.array([[1.1, (- 0.8)], [0.1, 0.5]]))
    np.testing.assert_array_almost_equal(indices, np.array([[1, 2], [0, 4]]))
def test_compute_floor_offsets_with_indices_and_targets(self):

    def graph_fn():
        y_source = tf.constant([1.5, 0.3], dtype=tf.float32)
        x_source = tf.constant([2.5, 4.2], dtype=tf.float32)
        y_target = tf.constant([2.1, 0.1], dtype=tf.float32)
        x_target = tf.constant([1.2, 4.5], dtype=tf.float32)
        (offsets, indices) = ta_utils.compute_floor_offsets_with_indices(y_source, x_source, y_target, x_target)
        return (offsets, indices)
    (offsets, indices) = self.execute(graph_fn, [])
    np.testing.assert_array_almost_equal(offsets, np.array([[1.1, (- 0.8)], [0.1, 0.5]]))
    np.testing.assert_array_almost_equal(indices, np.array([[1, 2], [0, 4]]))