class_docstr: Orthogonal Additive Kernels (OAKs) were introduced in [Lu2022additive]_, though
  only for the case of Gaussian base kernels with a Gaussian input data distribution.
  
  The implementation here generalizes OAKs to arbitrary base kernels by using a
  Gauss-Legendre quadrature approximation to the required one-dimensional integrals
  involving the base kernels.
  
  .. [Lu2022additive]
      X. Lu, A. Boukouvalas, and J. Hensman. Additive Gaussian processes revisited.
      Proceedings of the 39th International Conference on Machine Learning. Jul 2022.
class_docstr_tok: ["Orthogonal","Additive","Kernels","(","OAKs",")","were","introduced","in","[","Lu2022additive","]","_",",","though","only","for","the","case","of","Gaussian","base","kernels","with","a","Gaussian","input","data","distribution",".","The","implementation","here","generalizes","OAKs","to","arbitrary","base","kernels","by","using","a","Gauss-Legendre","quadrature","approximation","to","the","required","one-dimensional","integrals","involving","the","base","kernels",".","..","[","Lu2022additive","]","X.","Lu",",","A.","Boukouvalas",",","and","J.","Hensman",".","Additive","Gaussian","processes","revisited",".","Proceedings","of","the","39th","International","Conference","on","Machine","Learning",".","Jul","2022","."]
docstr: Returns the upper-triangular tensor of second-order coefficients.
  
  NOTE: We only keep track of the upper triangular part of raw second order
  coefficients since the effect of the lower triangular part is identical and
  exclude the diagonal, since it is associated with first-order effects only.
  While we could further exploit this structure in the forward pass, the
  associated indexing and temporary allocations make it significantly less
  efficient than the einsum-based implementation below.
  
  Returns:
      `batch_shape x d x d`-dim Tensor of second-order coefficients.
docstr_tok: ["Returns","the","upper-triangular","tensor","of","second-order","coefficients",".","NOTE",":","We","only","keep","track","of","the","upper","triangular","part","of","raw","second","order","coefficients","since","the","effect","of","the","lower","triangular","part","is","identical","and","exclude","the","diagonal",",","since","it","is","associated","with","first-order","effects","only",".","While","we","could","further","exploit","this","structure","in","the","forward","pass",",","the","associated","indexing","and","temporary","allocations","make","it","significantly","less","efficient","than","the","einsum-based","implementation","below",".","Returns",":","`","batch_shape","x","d","x","d","`","-dim","Tensor","of","second-order","coefficients","."]
code: def coeffs_2(self) -> Optional[Tensor]:
      """Returns the upper-triangular tensor of second-order coefficients.
  
      NOTE: We only keep track of the upper triangular part of raw second order
      coefficients since the effect of the lower triangular part is identical and
      exclude the diagonal, since it is associated with first-order effects only.
      While we could further exploit this structure in the forward pass, the
      associated indexing and temporary allocations make it significantly less
      efficient than the einsum-based implementation below.
  
      Returns:
          `batch_shape x d x d`-dim Tensor of second-order coefficients.
      """
      if self.raw_coeffs_2 is not None:
          C2 = self.coeff_constraint.transform(self.raw_coeffs_2)
          C2 = torch.cat(
              (C2, self._quad_zero), dim=-1
          )  # batch_shape x (d(d-1)/2+1)
          C2 = C2.index_select(-1, self._rev_triu_indices)
          return C2.reshape(*self.batch_shape, self.dim, self.dim)
      else:
          return None
  
imports: import math
  from typing import List, Optional, Tuple
  import numpy
  import torch
  from botorch.exceptions.errors import UnsupportedError
  from gpytorch.constraints import Interval, Positive
  from gpytorch.kernels import Kernel
  from torch import nn, Tensor
label_desc: Use image node_id 5 for calling the OrthogonalAdditiveKernel obj's underlying member method code with example usage: obj.coeffs_2() and returns: C2, None