code: def test_backward_pde_coeffs_with_nonconstant_params_1d(self):
      # vol = 2 * x**2
      # drift = 3 * x
      # discounting = 6 / x
      # x = [1, 2, 3]
  
      # batch_shape = (3, ), dim = 1
      # vol_fn(...).shape = batch_shape + (dim, dim) = (3, 1, 1)
      def vol_fn(t, x):
          del t
          x = x[:, 0]  # x.shape was (3, 1), now it's (3, )
          return tf.reshape(2 * x**2, (-1, 1, 1))
  
      # drift_fn(...).shape = batch_shape + (dim,) = (3, 1)
      def drift_fn(t, x):
          del t
          x = x[:, 0]
          return tf.reshape(3 * x, (-1, 1))
  
      # discounting_fn(...).shape = batch_shape = (3, )
      def discounting_fn(t, x):
          del t
          x = x[:, 0]
          return 6 / x
  
      coord_grid = [tf.constant([1, 2, 3])]
  
      process = tff.models.GenericItoProcess(
          dim=1,
          drift_fn=drift_fn,
          volatility_fn=vol_fn,
          dtype=tf.float32,
      )
  
      pde_solver_fn = mock.Mock()
      process.fd_solver_backward(
          start_time=0,
          end_time=0,
          coord_grid=coord_grid,
          values_grid=tf.constant([0]),
          discounting=discounting_fn,
          pde_solver_fn=pde_solver_fn,
      )
      kwargs = pde_solver_fn.call_args[1]
      second_order_coeff = self.evaluate(
          kwargs["second_order_coeff_fn"](0, coord_grid)
      )
      self.assertAllClose(
          np.array([[[2, 8**2 / 2, 18**2 / 2]]]), second_order_coeff
      )
      first_order_coeff = self.evaluate(
          kwargs["first_order_coeff_fn"](0, coord_grid)
      )
      self.assertAllClose(np.array([[3, 6, 9]]), first_order_coeff)
      zeroth_order_coeff = self.evaluate(
          kwargs["zeroth_order_coeff_fn"](0, coord_grid)
      )
      self.assertAllClose(np.array([-6, -3, -2]), zeroth_order_coeff)
  
imports: import os
  from unittest import mock
  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 8 for calling the GenericItoProcessTest obj's underlying member method code with example usage: obj.test_backward_pde_coeffs_with_nonconstant_params_1d() and returns: tf, tf, unknown