class_docstr: Base class for kernels which are functions of :math:`x \cdot z`.
docstr: Returns :math:`X \cdot Z`.
docstr_tok: ["Returns",":","math",":","`","X","\\cdot","Z","`","."]
code: def _dot_product(self, X, Z=None, diag=False):
      r"""
      Returns :math:`X \cdot Z`.
      """
      if Z is None:
          Z = X
      X = self._slice_input(X)
      if diag:
          return (X**2).sum(-1)
  
      Z = self._slice_input(Z)
      if X.size(1) != Z.size(1):
          raise ValueError(
              "Inputs must have the same number of features."
          )
  
      return X.matmul(Z.t())
  
file_path: pyro/pyro/contrib/gp/kernels/dot_product.py
imports: import torch
  from torch.distributions import constraints
  from pyro.contrib.gp.kernels.kernel import Kernel
  from pyro.nn.module import PyroParam
label_desc: Use image node_id 2 for calling the DotProduct obj's underlying member method code with example usage: obj._dot_product(X, Z, diag) and returns: X, unknown