docstr: Tests solving 2d diffusion equation in forward direction.
  
  The equation is `u_{t} - Dx u_{xx} - Dy u_{yy} = 0`.
  The initial condition is a gaussian centered at (0, 0) with variance sigma.
  The variance along each dimension should evolve as `sigma + 2 Dx (t - t_0)`
  and `sigma + 2 Dy (t - t_0)`.
docstr_tok: ["Tests","solving","2d","diffusion","equation","in","forward","direction",".","The","equation","is","`","u_","{","t","}","-","Dx","u_","{","xx","}","-","Dy","u_","{","yy","}","=","0","`",".","The","initial","condition","is","a","gaussian","centered","at","(","0",",","0",")","with","variance","sigma",".","The","variance","along","each","dimension","should","evolve","as","`","sigma","+","2","Dx","(","t","-","t_0",")","`","and","`","sigma","+","2","Dy","(","t","-","t_0",")","`","."]
code: def testAnisotropicDiffusion_InForwardDirection(self):
      """Tests solving 2d diffusion equation in forward direction.
  
      The equation is `u_{t} - Dx u_{xx} - Dy u_{yy} = 0`.
      The initial condition is a gaussian centered at (0, 0) with variance sigma.
      The variance along each dimension should evolve as `sigma + 2 Dx (t - t_0)`
      and `sigma + 2 Dy (t - t_0)`.
      """
      grid = grids.uniform_grid(
          minimums=[-10, -20],
          maximums=[10, 20],
          sizes=[201, 301],
          dtype=tf.float32,
      )
      ys = self.evaluate(grid[0])
      xs = self.evaluate(grid[1])
  
      diff_coeff_x = 0.4  # Dx
      diff_coeff_y = 0.25  # Dy
      time_step = 0.1
      final_t = 1.0
      initial_variance = 1
  
      def quadratic_coeff_fn(t, location_grid):
          del t, location_grid
          u_xx = -diff_coeff_x
          u_yy = -diff_coeff_y
          u_xy = None
          return [[u_yy, u_xy], [u_xy, u_xx]]
  
      final_values = tf.expand_dims(
          tf.constant(
              np.outer(
                  _gaussian(ys, initial_variance),
                  _gaussian(xs, initial_variance),
              ),
              dtype=tf.float32,
          ),
          axis=0,
      )
      bound_cond = [
          (_zero_boundary, _zero_boundary),
          (_zero_boundary, _zero_boundary),
      ]
      step_fn = douglas_adi_step(theta=0.5)
      result = fd_solvers.solve_forward(
          start_time=0.0,
          end_time=final_t,
          coord_grid=grid,
          values_grid=final_values,
          time_step=time_step,
          one_step_fn=step_fn,
          boundary_conditions=bound_cond,
          second_order_coeff_fn=quadratic_coeff_fn,
          dtype=grid[0].dtype,
      )
  
      variance_x = initial_variance + 2 * diff_coeff_x * final_t
      variance_y = initial_variance + 2 * diff_coeff_y * final_t
      expected = np.outer(
          _gaussian(ys, variance_y), _gaussian(xs, variance_x)
      )
  
      self._assertClose(expected, result)
  
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 17 for calling the MultidimParabolicEquationStepperTest obj's underlying member method code with example usage: obj.testAnisotropicDiffusion_InForwardDirection() and returns: list