code: def test_dynamic_shape(self, i_shape, num_dims):
      x_shape = (np.prod(i_shape[:num_dims]),) + (2, 2)
      y_shape = i_shape[:num_dims] + x_shape[1:]
  
      # Build a concrete function with fully dynamic input dimensions.
      x = tf.TensorSpec([None for _ in x_shape])
      i = tf.TensorSpec([None for _ in i_shape])
      split = tf.function(batch_apply.split_leading_dim)
      cf = split.get_concrete_function(x, i, num_dims)
      y_shape_dynamic = cf.output_shapes
      y_shape_dynamic.assert_is_compatible_with(y_shape)
  
      # Make use of the concrete function with fully specified inputs.
      x = tf.ones(x_shape)
      i = tf.ones(i_shape)
      y = cf(x, i)
      self.assertEqual(y.shape, y_shape)
  
imports: from absl.testing import parameterized
  import numpy
  from sonnet.src import base
  from sonnet.src import batch_apply
  from sonnet.src import test_utils
  import tensorflow
label_desc: Use image node_id 3 for calling the SplitLeadingDimTest obj's underlying member method code with example usage: obj.test_dynamic_shape(i_shape, num_dims) without return types