code: def compute_argmax_gaussian(model, approx_vars):
      approx_vars = approx_vars.intersection(model.input_vars)
      if not approx_vars:
          return {}
      if any(v.dtype != "real" for v in approx_vars):
          raise ValueError(
              "Argmax of non-normalized Gaussian mixtures is intentionally "
              "not implemented. You probably want to normalize. To work around, "
              "add a zero Tensor/Array with given inputs."
          )
  
      # Partition inputs into int_inputs + real_inputs.
      int_inputs = OrderedDict()
      real_inputs = OrderedDict()
      for k, d in model.inputs.items():
          if d.dtype == "real":
              real_inputs[k] = d
          else:
              int_inputs[k] = d
  
      approx_names = frozenset(v.name for v in approx_vars)
      if approx_names == frozenset(real_inputs):
          mode = model._mean
          offsets, _ = _compute_offsets(real_inputs)
          result = {}
          for key, domain in real_inputs.items():
              data = mode[
                  ..., offsets[key] : offsets[key] + domain.num_elements
              ]
              data = data.reshape(mode.shape[:-1] + domain.shape)
              result[key] = Tensor(data, int_inputs)
          return result
  
      raise NotImplementedError(
          "TODO implement partial argmax of real variables"
      )
  
imports: from collections import OrderedDict
  from functools import reduce, singledispatch
  from funsor.cnf import Contraction, GaussianMixture
  from funsor.delta import Delta
  from funsor.gaussian import Gaussian, _compute_offsets
  from funsor.instrument import debug_logged
  from funsor.integrate import Integrate
  from funsor.interpretations import DispatchedInterpretation
  from funsor.tensor import Tensor, align_tensor
  from funsor.terms import Approximate, Funsor
  from funsor.typing import deep_isinstance
  from .None import ops
label_desc: Use image node_id 7 for calling a global function with example usage: compute_argmax_gaussian(model, approx_vars) and returns: dict, result