code: def _compute_step_jacobian(state, next_state, params, tape):
      """Computes a Jacobian of a transformation next_state = f(state, params)."""
      n = len(state)
      p = len(params)
      js = [
          [
              _batch_jacobian(next_state[i], state[j], tape)
              for j in range(n)
          ]
          for i in range(n)
      ]
      jp = [
          [
              _jacobian_wrt_parameter(next_state[i], params[j], tape)
              for j in range(p)
          ]
          for i in range(n)
      ]
      return js, jp
  
file_path: tf-quant-finance/tf_quant_finance/math/custom_loops.py
imports: import tensorflow.compat.v2
  from tf_quant_finance import utils
label_desc: Use image node_id 3 for calling a global function with example usage: _compute_step_jacobian(state, next_state, params, tape) and returns: js,  jp