class_docstr: GPyTorch Downsampling Kernel.
  
  Computes a covariance matrix based on the down sampling kernel between
  inputs `x_1` and `x_2` (we expect `d = 1`):
  
      K(\mathbf{x_1}, \mathbf{x_2}) = c + (1 - x_1)^(1 + delta) *
          (1 - x_2)^(1 + delta).
  
  where `c` is an offset parameter, and `delta` is a power parameter.
class_docstr_tok: ["GPyTorch","Downsampling","Kernel",".","Computes","a","covariance","matrix","based","on","the","down","sampling","kernel","between","inputs","`","x_1","`","and","`","x_2","`","(","we","expect","`","d","=","1","`",")",":","K","(","\\mathbf","{","x_1","}",",","\\mathbf","{","x_2","}",")","=","c","+","(","1","-","x_1",")","^","(","1","+","delta",")","*","(","1","-","x_2",")","^","(","1","+","delta",")",".","where","`","c","`","is","an","offset","parameter",",","and","`","delta","`","is","a","power","parameter","."]
code: def forward(
      self,
      x1: Tensor,
      x2: Tensor,
      diag: Optional[bool] = False,
      last_dim_is_batch: Optional[bool] = False,
      **params,
  ) -> Tensor:
      offset = self.offset
      exponent = 1 + self.power
      if last_dim_is_batch:
          x1 = x1.transpose(-1, -2).unsqueeze(-1)
          x2 = x2.transpose(-1, -2).unsqueeze(-1)
      x1_ = 1 - x1
      x2_ = 1 - x2
  
      if diag:
          return offset + (x1_ * x2_).sum(dim=-1).pow(exponent)
  
      offset = offset.unsqueeze(
          -1
      )  # unsqueeze enables batch evaluation
      exponent = exponent.unsqueeze(
          -1
      )  # unsqueeze enables batch evaluation
      return offset + x1_.pow(exponent) @ x2_.transpose(-2, -1).pow(
          exponent
      )
  
file_path: botorch/botorch/models/kernels/downsampling.py
imports: from __future__ import annotations
  from typing import Optional
  import torch
  from gpytorch.constraints import Interval, Positive
  from gpytorch.kernels import Kernel
  from gpytorch.priors import Prior
  from torch import Tensor
label_desc: Use image node_id 8 for calling the DownsamplingKernel obj's underlying member method code with example usage: obj.forward(x1, x2, diag, last_dim_is_batch) and returns: unknown, unknown