def test_two_dim_even_input_and_keep_dims_true(self):
    x = np.array([[1., 2., 4., 50.], [1., 2., -4., 5.]]).T
    for q in [0, 10, 25, 49.9, 50, 50.01, 90, 95, 100]:
      expected_percentile = np.percentile(
          x, q=q, interpolation=self._interpolation, keepdims=True, axis=0)
      with self.test_session():
        pct = sample_stats.percentile(
            x,
            q=q,
            interpolation=self._interpolation,
            keep_dims=True,
            axis=[0])
        self.assertAllEqual((1, 2), pct.get_shape())
        self.assertAllClose(expected_percentile, pct.eval())