class_docstr: Computes a covariance matrix based on the Linear kernel
  between inputs :math:`\mathbf{x_1}` and :math:`\mathbf{x_2}`:
  
  .. math::
      \begin{equation*}
          k_\text{Linear}(\mathbf{x_1}, \mathbf{x_2}) = v\mathbf{x_1}^\top
          \mathbf{x_2}.
      \end{equation*}
  
  where
  
  * :math:`v` is a variance parameter.
  
  
  .. note::
  
      To implement this efficiently, we use a
      :obj:`~linear_operator.operators.RootLinearOperator` during training
      and a :class:`~linear_operator.operators.MatmulLinearOperator` during
      test. These lazy tensors represent matrices of the form :math:`\mathbf
      K = \mathbf X \mathbf X^{\prime \top}`. This makes inference efficient
      because a matrix-vector product :math:`\mathbf K \mathbf v` can be
      computed as :math:`\mathbf K \mathbf v = \mathbf X( \mathbf X^{\prime
      \top} \mathbf v)`, where the base multiply :math:`\mathbf X \mathbf v`
      takes only :math:`\mathcal O(ND)` time and space.
  
  :param variance_prior: Prior over the variance parameter. (Default `None`.)
  :param variance_constraint: Constraint to place on variance parameter. (Default: `Positive`.)
  :param active_dims: List of data dimensions to operate on. `len(active_dims)` should equal `num_dimensions`.
class_docstr_tok: ["Computes","a","covariance","matrix","based","on","the","Linear","kernel","between","inputs",":","math",":","`","\\mathbf","{","x_1","}","`","and",":","math",":","`","\\mathbf","{","x_2","}","`",":","..","math",":",":","\\begin","{","equation","*","}","k_\\text","{","Linear","}","(","\\mathbf","{","x_1","}",",","\\mathbf","{","x_2","}",")","=","v\\mathbf","{","x_1","}","^\\top","\\mathbf","{","x_2","}",".","\\end","{","equation","*","}","where","*",":","math",":","`","v","`","is","a","variance","parameter",".","..","note",":",":","To","implement","this","efficiently",",","we","use","a",":","obj",":","`","~linear_operator.operators.RootLinearOperator","`","during","training","and","a",":","class",":","`","~linear_operator.operators.MatmulLinearOperator","`","during","test",".","These","lazy","tensors","represent","matrices","of","the","form",":","math",":","`","\\mathbf","K","=","\\mathbf","X","\\mathbf","X^","{","\\prime","\\top","}","`",".","This","makes","inference","efficient","because","a","matrix-vector","product",":","math",":","`","\\mathbf","K","\\mathbf","v","`","can","be","computed","as",":","math",":","`","\\mathbf","K","\\mathbf","v","=","\\mathbf","X","(","\\mathbf","X^","{","\\prime","\\top","}","\\mathbf","v",")","`",",","where","the","base","multiply",":","math",":","`","\\mathbf","X","\\mathbf","v","`","takes","only",":","math",":","`","\\mathcal","O","(","ND",")","`","time","and","space",".",":","param","variance_prior",":","Prior","over","the","variance","parameter",".","(","Default","`","None","`",".",")",":","param","variance_constraint",":","Constraint","to","place","on","variance","parameter",".","(","Default",":","`","Positive","`",".",")",":","param","active_dims",":","List","of","data","dimensions","to","operate","on",".","`","len","(","active_dims",")","`","should","equal","`","num_dimensions","`","."]
code: def _set_variance(self, value: Union[float, Tensor]):
      if not torch.is_tensor(value):
          value = torch.as_tensor(value).to(self.raw_variance)
      self.initialize(
          raw_variance=self.raw_variance_constraint.inverse_transform(
              value
          )
      )
  
file_path: gpytorch/gpytorch/kernels/linear_kernel.py
imports: import warnings
  from typing import Optional, Union
  import torch
  from linear_operator.operators import LinearOperator, MatmulLinearOperator, RootLinearOperator
  from torch import Tensor
  from ..constraints import Interval, Positive
  from ..priors import Prior
  from .kernel import Kernel
label_desc: Use image node_id 4 for calling the LinearKernel obj's underlying member method code with example usage: obj._set_variance(value) without return types