docstr: Tests handling both inner_first_order_coeff and inner_second_order_coeff.
  
  We saw previously that the solution of
  `u_{t} - u_{xx} - u_{yy} - 2u_{x} - 4u_{y} - 5u = 0` is
  `u = exp(-x-2y) v`, where `v` solves the diffusion equation. Substitute now
  `u = exp(-x-2y) v` without expanding the derivatives:
  `v_{t} - exp(x)[exp(-x)v]_{xx} - exp(2y)[exp(-2y)v]_{yy} -
    2exp(x)[exp(-x)v]_{x} - 4exp(2y)[exp(-2y)v]_{y} - 5v = 0`.
  Solve this equation and expect the solution of the diffusion equation.
docstr_tok: ["Tests","handling","both","inner_first_order_coeff","and","inner_second_order_coeff",".","We","saw","previously","that","the","solution","of","`","u_","{","t","}","-","u_","{","xx","}","-","u_","{","yy","}","-","2u_","{","x","}","-","4u_","{","y","}","-","5u","=","0","`","is","`","u","=","exp","(","-x-2y",")","v","`",",","where","`","v","`","solves","the","diffusion","equation",".","Substitute","now","`","u","=","exp","(","-x-2y",")","v","`","without","expanding","the","derivatives",":","`","v_","{","t","}","-","exp","(","x",")","[","exp","(","-x",")","v","]","_","{","xx","}","-","exp","(","2y",")","[","exp","(","-2y",")","v","]","_","{","yy","}","-","2exp","(","x",")","[","exp","(","-x",")","v","]","_","{","x","}","-","4exp","(","2y",")","[","exp","(","-2y",")","v","]","_","{","y","}","-","5v","=","0","`",".","Solve","this","equation","and","expect","the","solution","of","the","diffusion","equation","."]
code: def testInnerFirstAndSecondOrderCoeff(self):
      """Tests handling both inner_first_order_coeff and inner_second_order_coeff.
  
      We saw previously that the solution of
      `u_{t} - u_{xx} - u_{yy} - 2u_{x} - 4u_{y} - 5u = 0` is
      `u = exp(-x-2y) v`, where `v` solves the diffusion equation. Substitute now
      `u = exp(-x-2y) v` without expanding the derivatives:
      `v_{t} - exp(x)[exp(-x)v]_{xx} - exp(2y)[exp(-2y)v]_{yy} -
        2exp(x)[exp(-x)v]_{x} - 4exp(2y)[exp(-2y)v]_{y} - 5v = 0`.
      Solve this equation and expect the solution of the diffusion equation.
      """
      grid = grids.uniform_grid(
          minimums=[0, 0],
          maximums=[1, 1],
          sizes=[201, 251],
          dtype=tf.float32,
      )
      ys, xs = grid
  
      final_t = 0.1
      time_step = 0.002
  
      def second_order_coeff_fn(t, coord_grid):
          del t
          y, x = tf.meshgrid(*coord_grid, indexing="ij")
          return [[-tf.exp(2 * y), None], [None, -tf.exp(x)]]
  
      def inner_second_order_coeff_fn(t, coord_grid):
          del t
          y, x = tf.meshgrid(*coord_grid, indexing="ij")
          return [[tf.exp(-2 * y), None], [None, tf.exp(-x)]]
  
      def first_order_coeff_fn(t, coord_grid):
          del t
          y, x = tf.meshgrid(*coord_grid, indexing="ij")
          return [-4 * tf.exp(2 * y), -2 * tf.exp(x)]
  
      def inner_first_order_coeff_fn(t, coord_grid):
          del t
          y, x = tf.meshgrid(*coord_grid, indexing="ij")
          return [tf.exp(-2 * y), tf.exp(-x)]
  
      def zeroth_order_coeff_fn(t, coord_grid):
          del t, coord_grid
          return -5
  
      initial = _reference_2d_pde_initial_cond(xs, ys)
      expected = _reference_2d_pde_solution(xs, ys, final_t)
  
      actual = fd_solvers.solve_forward(
          start_time=0,
          end_time=final_t,
          coord_grid=grid,
          values_grid=initial,
          time_step=time_step,
          second_order_coeff_fn=second_order_coeff_fn,
          first_order_coeff_fn=first_order_coeff_fn,
          zeroth_order_coeff_fn=zeroth_order_coeff_fn,
          inner_second_order_coeff_fn=inner_second_order_coeff_fn,
          inner_first_order_coeff_fn=inner_first_order_coeff_fn,
      )[0]
  
      self.assertAllClose(expected, actual, atol=1e-3, rtol=1e-3)
  
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 21 for calling the MultidimParabolicEquationStepperTest obj's underlying member method code with example usage: obj.testInnerFirstAndSecondOrderCoeff() and returns: list, list, list, list, unknown