class_docstr: Abstract base class for all Variational Strategies.
code: def amortized_exact_gp(
      self,
      mean_module: Optional[Module] = None,
      covar_module: Optional[Module] = None,
  ) -> ExactGP:
      mean_module = (
          self.model.mean_module if mean_module is None else mean_module
      )
      covar_module = (
          self.model.covar_module
          if covar_module is None
          else covar_module
      )
  
      with torch.no_grad():
          # from here on down, we refer to the inducing points as pseudo_inputs
          pseudo_target_covar, pseudo_target_mean = self.pseudo_points
          pseudo_inputs = self.inducing_points.detach()
          if pseudo_inputs.ndim < pseudo_target_mean.ndim:
              pseudo_inputs = pseudo_inputs.expand(
                  *pseudo_target_mean.shape[:-2], *pseudo_inputs.shape
              )
          # TODO: add flag for conditioning into SGPR after building fantasy strategy for SGPR
          new_covar_module = deepcopy(covar_module)
  
          # update inducing mean if necessary
          pseudo_target_mean = (
              pseudo_target_mean.squeeze() + mean_module(pseudo_inputs)
          )
  
          inducing_exact_model = _BaseExactGP(
              pseudo_inputs,
              pseudo_target_mean,
              mean_module=deepcopy(mean_module),
              covar_module=new_covar_module,
              likelihood=deepcopy(self.model.likelihood),
          )
  
          # now fantasize around this model
          # as this model is new, we need to compute a posterior to construct the prediction strategy
          # which uses the likelihood pseudo caches
          faked_points = torch.randn(
              *pseudo_target_mean.shape[:-2],
              1,
              pseudo_inputs.shape[-1],
              device=pseudo_inputs.device,
              dtype=pseudo_inputs.dtype,
          )
          inducing_exact_model.eval()
          _ = inducing_exact_model(faked_points)
  
          # then we overwrite the likelihood to take into account the multivariate normal term
          pred_strat = inducing_exact_model.prediction_strategy
          pred_strat._memoize_cache = {}
          with torch.no_grad():
              updated_lik_train_train_covar = (
                  pred_strat.train_prior_dist.lazy_covariance_matrix
                  + pseudo_target_covar
              )
              pred_strat.lik_train_train_covar = (
                  updated_lik_train_train_covar
              )
  
          # do the mean cache because the mean cache doesn't solve against lik_train_train_covar
          train_mean = inducing_exact_model.mean_module(
              *inducing_exact_model.train_inputs
          )
          train_labels_offset = (
              inducing_exact_model.prediction_strategy.train_labels
              - train_mean
          ).unsqueeze(-1)
          mean_cache = updated_lik_train_train_covar.solve(
              train_labels_offset
          ).squeeze(-1)
          mean_cache = _add_cache_hook(
              mean_cache, inducing_exact_model.prediction_strategy
          )
          add_to_cache(pred_strat, "mean_cache", mean_cache)
          # TODO: check to see if we need to do the covar_cache?
  
          inducing_exact_model.prediction_strategy = pred_strat
      return inducing_exact_model
  
imports: import functools
  from abc import ABC, abstractproperty
  from copy import deepcopy
  from typing import Optional, Tuple, Union
  import torch
  from linear_operator.operators import LinearOperator
  from torch import Tensor
  from ..None import settings
  from ..distributions import Delta, Distribution, MultivariateNormal
  from ..kernels import Kernel
  from ..likelihoods import GaussianLikelihood
  from ..means import Mean
  from ..models import ApproximateGP, ExactGP
  from ..models.exact_prediction_strategies import DefaultPredictionStrategy
  from ..module import Module
  from ..utils.memoize import add_to_cache, cached, clear_cache_hook
  from .None import _VariationalDistribution
label_desc: Use image node_id 10 for calling the _VariationalStrategy obj's underlying member method code with example usage: obj.amortized_exact_gp(mean_module, covar_module) and returns: inducing_exact_model