class_docstr: Tests for the variance_swaps module.
code: def test_replicating_weights_supports_batching(self):
      put_strikes = tf.constant([[100, 95, 90, 85]], dtype=np.float64)
      batch_put_strikes = batch_put_strikes = tf.concat(
          [put_strikes, put_strikes, 2 * (put_strikes - 100) + 100],
          axis=0,
      )
      batch_reference = tf.math.reduce_max(batch_put_strikes, axis=1)
      batch_expiries = tf.constant([0.25, 0.5, 0.25], dtype=tf.float64)
      expected_shape = np.array(batch_put_strikes.shape)
      expected_shape[-1] = expected_shape[-1] - 1
      batch_weights = self.evaluate(
          variance_swaps.replicating_weights(
              batch_put_strikes, batch_reference, batch_expiries
          )
      )
      self.assertAllEqual(batch_weights.shape, expected_shape)
      for i in range(3):
          row_weights = self.evaluate(
              variance_swaps.replicating_weights(
                  batch_put_strikes[i, :],
                  batch_reference[i],
                  batch_expiries[i],
              )
          )
          self.assertAllEqual(row_weights, batch_weights[i, :])
  
file_path: tf-quant-finance/tf_quant_finance/black_scholes/variance_swaps_test.py
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  import tf_quant_finance
  from tf_quant_finance.black_scholes import variance_swaps
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 2 for calling the VarianceSwapsTest obj's underlying member method code with example usage: obj.test_replicating_weights_supports_batching() without return types