def test_get_surrounding_grids(self):

    def graph_fn():
        y_coordinates = tf.constant([0.5], dtype=tf.float32)
        x_coordinates = tf.constant([4.5], dtype=tf.float32)
        output = ta_utils.get_surrounding_grids(height=3, width=5, y_coordinates=y_coordinates, x_coordinates=x_coordinates, radius=1)
        return output
    (y_indices, x_indices, valid) = self.execute(graph_fn, [])
    np.testing.assert_array_almost_equal(y_indices, np.array([[0.0, 0.0, 0.0, 0.0, 1.0]]))
    np.testing.assert_array_almost_equal(x_indices, np.array([[0.0, 3.0, 4.0, 0.0, 4.0]]))
    self.assertAllEqual(valid, [[False, True, True, False, True]])
def test_get_surrounding_grids(self):

    def graph_fn():
        y_coordinates = tf.constant([0.5], dtype=tf.float32)
        x_coordinates = tf.constant([4.5], dtype=tf.float32)
        output = ta_utils.get_surrounding_grids(height=3, width=5, y_coordinates=y_coordinates, x_coordinates=x_coordinates, radius=1)
        return output
    (y_indices, x_indices, valid) = self.execute(graph_fn, [])
    np.testing.assert_array_almost_equal(y_indices, np.array([[0.0, 0.0, 0.0, 0.0, 1.0]]))
    np.testing.assert_array_almost_equal(x_indices, np.array([[0.0, 3.0, 4.0, 0.0, 4.0]]))
    self.assertAllEqual(valid, [[False, True, True, False, True]])