docstr: Tests that the batch rank should be 1 if it is not empty.
docstr_tok: ["Tests","that","the","batch","rank","should","be","1","if","it","is","not","empty","."]
code: def test_invalid_batch_rank_piecewise(self):
      """Tests that the batch rank should be 1 if it is not empty."""
      dtype = tf.float64
      # Batch rank is 2
      mean_reversion = tff.math.piecewise.PiecewiseConstantFunc(
          [[[0.1, 2.0]]],
          values=[[3 * [self.mean_reversion]]],
          dtype=dtype,
      )
      # Volatility with batch dimesnion
      volatility = self.volatility
      with self.assertRaises(ValueError):
          tff.models.hull_white.VectorHullWhiteModel(
              dim=2,
              mean_reversion=mean_reversion,
              volatility=volatility,
              corr_matrix=None,
              initial_discount_rate_fn=self.instant_forward_rate_2d_fn,
              dtype=dtype,
          )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 9 for calling the HullWhiteTest obj's underlying member method code with example usage: obj.test_invalid_batch_rank_piecewise() without return types