code: def test_pathfinder():
      target = tfd.Independent(
          tfd.StudentT(
              3.0, loc=jnp.array([1.0, 2]), scale=jnp.array([1.0, 1.0])
          ),
          reinterpreted_batch_ndims=1,
      ).log_prob
  
      key = jax.random.PRNGKey(3)
      init = jnp.zeros(2)
      draws, _ = pathfinder.pathfinder(
          target_density=target,
          initial_value=init,
          lbfgs_max_iters=20,
          num_draws=1000,
          key=key,
      )
      assert (
          jnp.linalg.norm(
              jnp.mean(draws, axis=0) - jnp.array([1.0, 2.0]), ord=2
          )
          < 0.1
      )
  
file_path: probability/discussion/pathfinder/pathfinder_test.py
imports: import jax
  import jax.numpy
  import numpy
  import pytest
  from discussion.pathfinder import pathfinder
  import tensorflow_probability.substrates.jax
label_desc: Use image node_id 5 for calling a global function with example usage: test_pathfinder() without return types