class_docstr: Builds Approximation instance from a given trace,
  it has the same interface as variational approximation
class_docstr_tok: ["Builds","Approximation","instance","from","a","given","trace",",","it","has","the","same","interface","as","variational","approximation"]
code: def _check_trace(self):
      trace = self._kwargs.get("trace", None)
      if isinstance(trace, InferenceData):
          raise NotImplementedError(
              "The `Empirical` approximation does not yet support `InferenceData` inputs."
              " Pass `pm.sample(return_inferencedata=False)` to get a `MultiTrace` to use with `Empirical`."
              " Please help us to refactor: https://github.com/pymc-devs/pymc/issues/5884"
          )
      elif trace is not None and not all(
          [
              self.model.rvs_to_values[var].name in trace.varnames
              for var in self.group
          ]
      ):
          raise ValueError("trace has not all free RVs in the group")
  
imports: from typing import Optional
  import numpy
  import pytensor
  from arviz import InferenceData
  from pytensor import tensor
  from pytensor.graph.basic import Variable
  from pytensor.graph.replace import graph_replace
  from pytensor.tensor.variable import TensorVariable
  import pymc
  from pymc.blocking import DictToArrayBijection
  from pymc.distributions.dist_math import rho2sigma
  from pymc.util import makeiter
  from pymc.variational import opvi
  from pymc.variational.opvi import Approximation, Group, NotImplementedInference, _known_scan_ignored_inputs, node_property
label_desc: Use image node_id 3 for calling the EmpiricalGroup obj's underlying member method code with example usage: obj._check_trace() without return types