code: def _linear_integrate(init, trans, shift):
      """
      Integrate the inhomogeneous linear shifterence equation::
  
          x[0] = init
          x[t] = x[t-1] @ trans[t] + shift[t]
  
      :return: An integrated tensor ``x[:, :]``.
      """
      # xs: List[Tensor]
      xs = []
      x = init.unsqueeze(-2)
      shift = shift.unsqueeze(-3)
      for t in range(trans.size(-3)):
          x = x @ trans[..., t, :, :] + shift[..., t, :]
          xs.append(x)
      return torch.cat(xs, dim=-2)
  
imports: import torch
  import torch.nn.functional
  from pyro.ops.gamma_gaussian import GammaGaussian, gamma_and_mvn_to_gamma_gaussian, gamma_gaussian_tensordot, matrix_and_mvn_to_gamma_gaussian
  from pyro.ops.gaussian import Gaussian, gaussian_tensordot, matrix_and_mvn_to_gaussian, mvn_to_gaussian, sequential_gaussian_filter_sample, sequential_gaussian_tensordot
  from pyro.ops.indexing import Vindex
  from pyro.ops.special import safe_log
  from pyro.ops.tensor_utils import cholesky_solve, safe_cholesky
  from .None import constraints
  from .torch import Categorical, Gamma, Independent, MultivariateNormal
  from .torch_distribution import TorchDistribution
  from .util import broadcast_shape, torch_jit_script_if_tracing
label_desc: Use image node_id 1 for calling a global function with example usage: _linear_integrate(init, trans, shift) and returns: torch