class_docstr: This is an implementation of GPR that provides a posterior() method that
  enables caching for faster subsequent predictions.
class_docstr_tok: ["This","is","an","implementation","of","GPR","that","provides","a","posterior","(",")","method","that","enables","caching","for","faster","subsequent","predictions","."]
docstr: Create the Posterior object which contains precomputed matrices for
  faster prediction.
  
  precompute_cache has three settings:
  
  - `PrecomputeCacheType.TENSOR` (or `"tensor"`): Precomputes the cached
    quantities and stores them as tensors (which allows differentiating
    through the prediction). This is the default.
  - `PrecomputeCacheType.VARIABLE` (or `"variable"`): Precomputes the cached
    quantities and stores them as variables, which allows for updating
    their values without changing the compute graph (relevant for AOT
    compilation).
  - `PrecomputeCacheType.NOCACHE` (or `"nocache"` or `None`): Avoids
    immediate cache computation. This is useful for avoiding extraneous
    computations when you only want to call the posterior's
    `fused_predict_f` method.
docstr_tok: ["Create","the","Posterior","object","which","contains","precomputed","matrices","for","faster","prediction",".","precompute_cache","has","three","settings",":","-","`","PrecomputeCacheType.TENSOR","`","(","or","`","``","tensor","''","`",")",":","Precomputes","the","cached","quantities","and","stores","them","as","tensors","(","which","allows","differentiating","through","the","prediction",")",".","This","is","the","default",".","-","`","PrecomputeCacheType.VARIABLE","`","(","or","`","``","variable","''","`",")",":","Precomputes","the","cached","quantities","and","stores","them","as","variables",",","which","allows","for","updating","their","values","without","changing","the","compute","graph","(","relevant","for","AOT","compilation",")",".","-","`","PrecomputeCacheType.NOCACHE","`","(","or","`","``","nocache","''","`","or","`","None","`",")",":","Avoids","immediate","cache","computation",".","This","is","useful","for","avoiding","extraneous","computations","when","you","only","want","to","call","the","posterior's","`","fused_predict_f","`","method","."]
code: def posterior(
      self,
      precompute_cache: posteriors.PrecomputeCacheType = posteriors.PrecomputeCacheType.TENSOR,
  ) -> posteriors.GPRPosterior:
      """
      Create the Posterior object which contains precomputed matrices for
      faster prediction.
  
      precompute_cache has three settings:
  
      - `PrecomputeCacheType.TENSOR` (or `"tensor"`): Precomputes the cached
        quantities and stores them as tensors (which allows differentiating
        through the prediction). This is the default.
      - `PrecomputeCacheType.VARIABLE` (or `"variable"`): Precomputes the cached
        quantities and stores them as variables, which allows for updating
        their values without changing the compute graph (relevant for AOT
        compilation).
      - `PrecomputeCacheType.NOCACHE` (or `"nocache"` or `None`): Avoids
        immediate cache computation. This is useful for avoiding extraneous
        computations when you only want to call the posterior's
        `fused_predict_f` method.
      """
  
      return posteriors.GPRPosterior(
          kernel=self.kernel,
          data=self.data,
          likelihood=self.likelihood,
          mean_function=self.mean_function,
          precompute_cache=precompute_cache,
      )
  
imports: from typing import Optional
  import tensorflow
  from check_shapes import check_shapes, inherit_check_shapes
  import gpflow
  from ..None import posteriors
  from ..base import InputData, MeanAndVariance, RegressionData, TensorData
  from ..kernels import Kernel
  from ..likelihoods import Gaussian
  from ..logdensities import multivariate_normal
  from ..mean_functions import MeanFunction
  from ..utilities import add_likelihood_noise_cov, assert_params_false
  from .model import GPModel
  from .training_mixins import InternalDataTrainingLossMixin
  from .util import data_input_to_tensor
label_desc: Use image node_id 1 for calling the GPR_with_posterior obj's underlying member method code with example usage: obj.posterior(precompute_cache) and returns: posteriors