docstr: Tests the default parameters for 2 dimensional Brownian Motion.
docstr_tok: ["Tests","the","default","parameters","for","2","dimensional","Brownian","Motion","."]
code: def test_default_construction_2d(self):
      """Tests the default parameters for 2 dimensional Brownian Motion."""
      process = BrownianMotion(dim=2)
      self.assertEqual(process.dim(), 2)
      drift_fn = process.total_drift_fn()
      # Drifts should be zero.
      t0 = np.array([0.2, 0.7, 0.9])
      delta_t = np.array([0.1, 0.8, 0.3])
      t1 = t0 + delta_t
      drifts = self.evaluate(drift_fn(t0, t1))
      self.assertEqual(drifts.shape, (3, 2))
      self.assertArrayNear(
          drifts.reshape([-1]), np.zeros([3 * 2]), 1e-10
      )
      variances = self.evaluate(process.total_covariance_fn()(t0, t1))
      self.assertEqual(variances.shape, (3, 2, 2))
      expected_variances = np.eye(2) * delta_t.reshape([-1, 1, 1])
      print(variances, expected_variances)
  
      self.assertArrayNear(
          variances.reshape([-1]),
          expected_variances.reshape([-1]),
          1e-10,
      )
  
file_path: tf-quant-finance/tf_quant_finance/models/legacy/brownian_motion_test.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow.python.framework import test_util
  from tf_quant_finance.models.legacy.brownian_motion import BrownianMotion
label_desc: Use image node_id 3 for calling the BrownianMotionTest obj's underlying member method code with example usage: obj.test_default_construction_2d() without return types