code: def testBroadcastingPdfArgs(self):
      def _assert_shape(gev_dist, arg, shape):
          self.assertEqual(gev_dist.log_prob(arg).shape, shape)
          self.assertEqual(gev_dist.prob(arg).shape, shape)
  
      def _check(gev_dist):
          _assert_shape(gev_dist, 5.0, (3,))
          xs = np.array([5.0, 6.0, 7.0], dtype=np.float32)
          _assert_shape(gev_dist, xs, (3,))
          xs = np.array([xs])
          _assert_shape(gev_dist, xs, (1, 3))
          xs = xs.T
          _assert_shape(gev_dist, xs, (3, 3))
  
      _check(
          gev.GeneralizedExtremeValue(
              loc=[
                  -2.0,
                  -3.0,
                  -4.0,
              ],
              scale=2.0,
              concentration=1.0,
              validate_args=True,
          )
      )
      _check(
          gev.GeneralizedExtremeValue(
              loc=-6.0,
              scale=[
                  2.0,
                  3.0,
                  4.0,
              ],
              concentration=1.0,
              validate_args=True,
          )
      )
      _check(
          gev.GeneralizedExtremeValue(
              loc=-7.0,
              scale=3.0,
              concentration=[
                  2.0,
                  3.0,
                  4.0,
              ],
              validate_args=True,
          )
      )
  
      def _check2d(gev_dist):
          _assert_shape(gev_dist, 5.0, (1, 3))
          xs = np.array([5.0, 6.0, 7.0], dtype=np.float32)
          _assert_shape(gev_dist, xs, (1, 3))
          xs = np.array([xs])
          _assert_shape(gev_dist, xs, (1, 3))
          xs = xs.T
          _assert_shape(gev_dist, xs, (3, 3))
  
      _check2d(
          gev.GeneralizedExtremeValue(
              loc=[
                  [
                      -2.0,
                      -3.0,
                      -4.0,
                  ]
              ],
              scale=2.0,
              concentration=1.0,
              validate_args=True,
          )
      )
      _check2d(
          gev.GeneralizedExtremeValue(
              loc=-7.0,
              scale=[
                  [
                      2.0,
                      3.0,
                      4.0,
                  ]
              ],
              concentration=1.0,
              validate_args=True,
          )
      )
      _check2d(
          gev.GeneralizedExtremeValue(
              loc=-7.0,
              scale=3.0,
              concentration=[
                  [
                      2.0,
                      3.0,
                      4.0,
                  ]
              ],
              validate_args=True,
          )
      )
  
      def _check2d_rows(gev_dist):
          _assert_shape(gev_dist, 5.0, (3, 1))
          xs = np.array([5.0, 6.0, 7.0], dtype=np.float32)  # (3,)
          _assert_shape(gev_dist, xs, (3, 3))
          xs = np.array([xs])  # (1,3)
          _assert_shape(gev_dist, xs, (3, 3))
          xs = xs.T  # (3,1)
          _assert_shape(gev_dist, xs, (3, 1))
  
      _check2d_rows(
          gev.GeneralizedExtremeValue(
              loc=[[-2.0], [-3.0], [-4.0]],
              scale=2.0,
              concentration=1.0,
              validate_args=True,
          )
      )
      _check2d_rows(
          gev.GeneralizedExtremeValue(
              loc=-7.0,
              scale=[[2.0], [3.0], [4.0]],
              concentration=1.0,
              validate_args=True,
          )
      )
      _check2d_rows(
          gev.GeneralizedExtremeValue(
              loc=-7.0,
              scale=3.0,
              concentration=[[2.0], [3.0], [4.0]],
              validate_args=True,
          )
      )
  
imports: import numpy
  from scipy import stats
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import gev
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 17 for calling the _GEVTest obj's underlying member method code with example usage: obj.testBroadcastingPdfArgs() without return types