class_docstr: Non-normalized GammaGaussian distribution:
  
      GammaGaussian(x, s) ~ (concentration + 0.5 * dim - 1) * log(s)
                            - rate * s - s * 0.5 * info_vec.T @ inv(precision) @ info_vec)
                            - s * 0.5 * x.T @ precision @ x + s * x.T @ info_vec,
  
  which will be reparameterized as
  
      GammaGaussian(x, s) =: alpha * log(s) + s * (-0.5 * x.T @ precision @ x + x.T @ info_vec - beta).
  
  The `s` variable plays the role of a mixing variable such that
  
      p(x | s) ~ Gaussian(s * info_vec, s * precision).
  
  Conditioned on `s`, this represents an arbitrary semidefinite quadratic function,
  which can be interpreted as a rank-deficient Gaussian distribution.
  The precision matrix may have zero eigenvalues, thus it may be impossible
  to work directly with the covariance matrix.
  
  :param torch.Tensor log_normalizer: a normalization constant, which is mainly used to keep
      track of normalization terms during contractions.
  :param torch.Tensor info_vec: information vector, which is a scaled version of the mean
      ``info_vec = precision @ mean``. We use this represention to make gaussian contraction
      fast and stable.
  :param torch.Tensor precision: precision matrix of this gaussian.
  :param torch.Tensor alpha: reparameterized shape parameter of the marginal Gamma distribution of
      `s`. The shape parameter Gamma.concentration is reparameterized by:
  
          alpha = Gamma.concentration + 0.5 * dim - 1
  
  :param torch.Tensor beta: reparameterized rate parameter of the marginal Gamma distribution of
      `s`. The rate parameter Gamma.rate is reparameterized by:
  
          beta = Gamma.rate + 0.5 * info_vec.T @ inv(precision) @ info_vec
docstr: Condition the Gaussian component on a trailing subset of its state.
  This should satisfy::
  
      g.condition(y).dim() == g.dim() - y.size(-1)
  
  Note that since this is a non-normalized Gaussian, we include the
  density of ``y`` in the result. Thus :meth:`condition` is similar to a
  ``functools.partial`` binding of arguments::
  
      left = x[..., :n]
      right = x[..., n:]
      g.log_density(x, s) == g.condition(right).log_density(left, s)
docstr_tok: ["Condition","the","Gaussian","component","on","a","trailing","subset","of","its","state",".","This","should","satisfy",":",":","g.condition","(","y",")",".dim","(",")","==","g.dim","(",")","-","y.size","(","-1",")","Note","that","since","this","is","a","non-normalized","Gaussian",",","we","include","the","density","of","``","y","``","in","the","result",".","Thus",":","meth",":","`","condition","`","is","similar","to","a","``","functools.partial","``","binding","of","arguments",":",":","left","=","x","[","...",",",":","n","]","right","=","x","[","...",",","n",":","]","g.log_density","(","x",",","s",")","==","g.condition","(","right",")",".log_density","(","left",",","s",")"]
code: def condition(self, value):
      """
      Condition the Gaussian component on a trailing subset of its state.
      This should satisfy::
  
          g.condition(y).dim() == g.dim() - y.size(-1)
  
      Note that since this is a non-normalized Gaussian, we include the
      density of ``y`` in the result. Thus :meth:`condition` is similar to a
      ``functools.partial`` binding of arguments::
  
          left = x[..., :n]
          right = x[..., n:]
          g.log_density(x, s) == g.condition(right).log_density(left, s)
      """
      assert isinstance(value, torch.Tensor)
      assert value.size(-1) <= self.info_vec.size(-1)
  
      n = self.dim() - value.size(-1)
      info_a = self.info_vec[..., :n]
      info_b = self.info_vec[..., n:]
      P_aa = self.precision[..., :n, :n]
      P_ab = self.precision[..., :n, n:]
      P_bb = self.precision[..., n:, n:]
      b = value
  
      info_vec = info_a - P_ab.matmul(b.unsqueeze(-1)).squeeze(-1)
      precision = P_aa
  
      log_normalizer = self.log_normalizer
      alpha = self.alpha
      beta = (
          self.beta
          + 0.5
          * P_bb.matmul(b.unsqueeze(-1)).squeeze(-1).mul(b).sum(-1)
          - b.mul(info_b).sum(-1)
      )
      return GammaGaussian(
          log_normalizer, info_vec, precision, alpha, beta
      )
  
imports: import math
  import torch
  from torch.distributions.utils import lazy_property
  from torch.nn.functional import pad
  from pyro.distributions.multivariate_studentt import MultivariateStudentT
  from pyro.distributions.torch import MultivariateNormal
  from pyro.distributions.util import broadcast_shape
  from pyro.ops.tensor_utils import precision_to_scale_tril
label_desc: Use image node_id 12 for calling the GammaGaussian obj's underlying member method code with example usage: obj.condition(value) and returns: GammaGaussian