docstr: Get map of var_name -> set(input var names) for the model
docstr_tok: ["Get","map","of","var_name","-",">","set","(","input","var","names",")","for","the","model"]
code: def make_compute_graph(
      self, var_names: Optional[Iterable[VarName]] = None
  ) -> Dict[VarName, Set[VarName]]:
      """Get map of var_name -> set(input var names) for the model"""
      input_map: Dict[VarName, Set[VarName]] = defaultdict(set)
  
      for var_name in self.vars_to_plot(var_names):
          var = self.model[var_name]
          parent_name = self.get_parent_names(var)
          input_map[var_name] = input_map[var_name].union(parent_name)
  
          if var in self.model.observed_RVs:
              obs_node = self.model.rvs_to_values[var]
  
              # loop created so that the elif block can go through this again
              # and remove any intermediate ops, notably dtype casting, to observations
              while True:
                  obs_name = obs_node.name
                  if obs_name and obs_name != var_name:
                      input_map[var_name] = input_map[
                          var_name
                      ].difference({obs_name})
                      input_map[obs_name] = input_map[obs_name].union(
                          {var_name}
                      )
                      break
                  elif (
                      # for cases where observations are cast to a certain dtype
                      # see issue 5795: https://github.com/pymc-devs/pymc/issues/5795
                      obs_node.owner
                      and isinstance(obs_node.owner.op, Elemwise)
                      and isinstance(obs_node.owner.op.scalar_op, Cast)
                  ):
                      # we can retrieve the observation node by going up the graph
                      obs_node = obs_node.owner.inputs[0]
                  else:
                      break
  
      return input_map
  
imports: import warnings
  from collections import defaultdict
  from typing import Dict, Iterable, List, Optional, Sequence, Set
  from pytensor import function
  from pytensor.compile.sharedvalue import SharedVariable
  from pytensor.graph import Apply
  from pytensor.graph.basic import ancestors, walk
  from pytensor.scalar.basic import Cast
  from pytensor.tensor.elemwise import Elemwise
  from pytensor.tensor.random.op import RandomVariable
  from pytensor.tensor.shape import Shape
  from pytensor.tensor.variable import TensorConstant, TensorVariable
  import pymc
  from pymc.util import VarName, get_default_varnames, get_var_name
label_desc: Use image node_id 4 for calling the ModelGraph obj's underlying member method code with example usage: obj.make_compute_graph(var_names) and returns: input_map