class_docstr: A Posterior represented by a list of independent Posteriors.
  
  When at least one of the posteriors is a `GaussianMixturePosterior`, the other
  posteriors are expanded to match the size of the `GaussianMixturePosterior`.
class_docstr_tok: ["A","Posterior","represented","by","a","list","of","independent","Posteriors",".","When","at","least","one","of","the","posteriors","is","a","`","GaussianMixturePosterior","`",",","the","other","posteriors","are","expanded","to","match","the","size","of","the","`","GaussianMixturePosterior","`","."]
docstr: Reshape a tensor without an MCMC batch dimension to match the shape.
docstr_tok: ["Reshape","a","tensor","without","an","MCMC","batch","dimension","to","match","the","shape","."]
code: def _reshape_tensor(X: Tensor, mcmc_samples: int) -> Tensor:
      """Reshape a tensor without an MCMC batch dimension to match the shape."""
      X = X.unsqueeze(MCMC_DIM)
      return X.expand(
          *X.shape[:MCMC_DIM], mcmc_samples, *X.shape[MCMC_DIM + 1 :]
      )
  
imports: from __future__ import annotations
  from functools import cached_property
  from typing import Any, List, Optional
  import torch
  from botorch.posteriors.fully_bayesian import GaussianMixturePosterior, MCMC_DIM
  from botorch.posteriors.posterior import Posterior
  from torch import Tensor
label_desc: Use image node_id 4 for calling the PosteriorList obj's underlying member method code with example usage: obj._reshape_tensor(X, mcmc_samples) and returns: X