code: def _compute_cfim(p, dp):
      r"""Computes the (num_params, num_params) classical fisher information matrix from the probabilities and its derivatives
      I.e. it computes :math:`classical_fisher_{ij} = \sum_\ell (\partial_i p_\ell) (\partial_i p_\ell) / p_\ell`
      """
      # Exclude values where p=0 and calculate 1/p
      nonzeros_p = qml.math.where(p > 0, p, qml.math.ones_like(p))
      one_over_p = qml.math.where(
          p > 0, qml.math.ones_like(p), qml.math.zeros_like(p)
      )
      one_over_p = one_over_p / nonzeros_p
  
      # Multiply dp and p
      # Note that casting and being careful about dtypes is necessary as interfaces
      # typically treat derivatives (dp) with float32, while standard execution (p) comes in float64
      dp = qml.math.cast_like(dp, p)
      dp = qml.math.reshape(
          dp, (len(p), -1)
      )  # Squeeze does not work, as you could have shape (num_probs, num_params) with num_params = 1
      dp_over_p = (
          qml.math.transpose(dp) * one_over_p
      )  # creates (n_params, n_probs) array
  
      # (n_params, n_probs) @ (n_probs, n_params) = (n_params, n_params)
      return dp_over_p @ dp
  
imports: from functools import partial
  from typing import Callable, Sequence
  import pennylane
  from pennylane.tape import QuantumTape
  from pennylane.devices import DefaultQubit, DefaultQubitLegacy, DefaultMixed
  from pennylane.measurements import StateMP, DensityMatrixMP
  from pennylane.gradients import adjoint_metric_tensor, metric_tensor
  from pennylane import transform
label_desc: Use image node_id 11 for calling a global function with example usage: _compute_cfim(p, dp) and returns: unknown