class_docstr: This strategy constrains the inducing points to a grid and applies a deterministic
  relationship between :math:`\mathbf f` and :math:`\mathbf u`.
  It was introduced by `Wilson et al. (2016)`_.
  
  Here, the inducing points are not learned. Instead, the strategy
  automatically creates inducing points based on a set of grid sizes and grid
  bounds.
  
  .. _Wilson et al. (2016):
      https://arxiv.org/abs/1611.00336
  
  :param ~gpytorch.models.ApproximateGP model: Model this strategy is applied to.
      Typically passed in when the VariationalStrategy is created in the
      __init__ method of the user defined model.
  :param int grid_size: Size of the grid
  :param list grid_bounds: Bounds of each dimension of the grid (should be a list of (float, float) tuples)
  :param ~gpytorch.variational.VariationalDistribution variational_distribution: A
      VariationalDistribution object that represents the form of the variational distribution :math:`q(\mathbf u)`
class_docstr_tok: ["This","strategy","constrains","the","inducing","points","to","a","grid","and","applies","a","deterministic","relationship","between",":","math",":","`","\\mathbf","f","`","and",":","math",":","`","\\mathbf","u","`",".","It","was","introduced","by","`","Wilson","et","al",".","(","2016",")","`","_",".","Here",",","the","inducing","points","are","not","learned",".","Instead",",","the","strategy","automatically","creates","inducing","points","based","on","a","set","of","grid","sizes","and","grid","bounds",".","..","_Wilson","et","al",".","(","2016",")",":","https",":","\/\/arxiv.org\/abs\/1611.00336",":","param","~gpytorch.models.ApproximateGP","model",":","Model","this","strategy","is","applied","to",".","Typically","passed","in","when","the","VariationalStrategy","is","created","in","the","__init__","method","of","the","user","defined","model",".",":","param","int","grid_size",":","Size","of","the","grid",":","param","list","grid_bounds",":","Bounds","of","each","dimension","of","the","grid","(","should","be","a","list","of","(","float",",","float",")","tuples",")",":","param","~gpytorch.variational.VariationalDistribution","variational_distribution",":","A","VariationalDistribution","object","that","represents","the","form","of","the","variational","distribution",":","math",":","`","q","(","\\mathbf","u",")","`"]
code: def _compute_grid(self, inputs):
      n_data, n_dimensions = inputs.size(-2), inputs.size(-1)
      batch_shape = inputs.shape[:-2]
  
      inputs = inputs.reshape(-1, n_dimensions)
      interp_indices, interp_values = Interpolation().interpolate(
          self.grid, inputs
      )
      interp_indices = interp_indices.view(*batch_shape, n_data, -1)
      interp_values = interp_values.view(*batch_shape, n_data, -1)
  
      if (interp_indices.dim() - 2) != len(
          self._variational_distribution.batch_shape
      ):
          batch_shape = torch.broadcast_shapes(
              interp_indices.shape[:-2],
              self._variational_distribution.batch_shape,
          )
          interp_indices = interp_indices.expand(
              *batch_shape, *interp_indices.shape[-2:]
          )
          interp_values = interp_values.expand(
              *batch_shape, *interp_values.shape[-2:]
          )
      return interp_indices, interp_values
  
file_path: gpytorch/gpytorch/variational/grid_interpolation_variational_strategy.py
imports: import torch
  from linear_operator.operators import InterpolatedLinearOperator
  from linear_operator.utils.interpolation import left_interp
  from ..distributions import MultivariateNormal
  from ..utils.interpolation import Interpolation
  from ..utils.memoize import cached
  from ._variational_strategy import _VariationalStrategy
label_desc: Use image node_id 2 for calling the GridInterpolationVariationalStrategy obj's underlying member method code with example usage: obj._compute_grid(inputs) and returns: interp_indices,  interp_values