class_docstr: Product kernel implementation.
docstr: Return the kernel k(X, Y) and optionally its gradient.
  
  Parameters
  ----------
  X : np.ndarray, shape (n_samples_X, n_features)
      Left argument of the returned kernel k(X, Y).
  
  Y : np.ndarray, shape (n_samples_Y, n_features), (optional, default=None)
      Right argument of the returned kernel k(X, Y). If None, k(X, X)
      is evaluated instead.
  
  eval_gradient : bool (optional, default=False)
      Determines whether the gradient with respect to the kernel
      hyperparameter is determined.
  
  active : np.ndarray (n_samples_X, n_features) (optional)
      Boolean array specifying which hyperparameters are active.
  
  Returns
  -------
  K : np.ndarray, shape (n_samples_X, n_samples_Y)
      Kernel k(X, Y).
  
  K_gradient : np.ndarray (opt.), shape (n_samples_X, n_samples_X, n_dims)
      The gradient of the kernel k(X, X) with respect to the
      hyperparameter of the kernel. Only returned when eval_gradient
      is True.
docstr_tok: ["Return","the","kernel","k","(","X",",","Y",")","and","optionally","its","gradient",".","Parameters","--","--","--","--","--","X",":","np.ndarray",",","shape","(","n_samples_X",",","n_features",")","Left","argument","of","the","returned","kernel","k","(","X",",","Y",")",".","Y",":","np.ndarray",",","shape","(","n_samples_Y",",","n_features",")",",","(","optional",",","default=None",")","Right","argument","of","the","returned","kernel","k","(","X",",","Y",")",".","If","None",",","k","(","X",",","X",")","is","evaluated","instead",".","eval_gradient",":","bool","(","optional",",","default=False",")","Determines","whether","the","gradient","with","respect","to","the","kernel","hyperparameter","is","determined",".","active",":","np.ndarray","(","n_samples_X",",","n_features",")","(","optional",")","Boolean","array","specifying","which","hyperparameters","are","active",".","Returns","--","--","--","-","K",":","np.ndarray",",","shape","(","n_samples_X",",","n_samples_Y",")","Kernel","k","(","X",",","Y",")",".","K_gradient",":","np.ndarray","(","opt",".",")",",","shape","(","n_samples_X",",","n_samples_X",",","n_dims",")","The","gradient","of","the","kernel","k","(","X",",","X",")","with","respect","to","the","hyperparameter","of","the","kernel",".","Only","returned","when","eval_gradient","is","True","."]
code: def __call__(
      self,
      X: np.ndarray,
      Y: np.ndarray | None = None,
      eval_gradient: bool = False,
      active: np.ndarray | None = None,
  ) -> np.ndarray | tuple[np.ndarray, np.ndarray]:
      """Return the kernel k(X, Y) and optionally its gradient.
  
      Parameters
      ----------
      X : np.ndarray, shape (n_samples_X, n_features)
          Left argument of the returned kernel k(X, Y).
  
      Y : np.ndarray, shape (n_samples_Y, n_features), (optional, default=None)
          Right argument of the returned kernel k(X, Y). If None, k(X, X)
          is evaluated instead.
  
      eval_gradient : bool (optional, default=False)
          Determines whether the gradient with respect to the kernel
          hyperparameter is determined.
  
      active : np.ndarray (n_samples_X, n_features) (optional)
          Boolean array specifying which hyperparameters are active.
  
      Returns
      -------
      K : np.ndarray, shape (n_samples_X, n_samples_Y)
          Kernel k(X, Y).
  
      K_gradient : np.ndarray (opt.), shape (n_samples_X, n_samples_X, n_dims)
          The gradient of the kernel k(X, X) with respect to the
          hyperparameter of the kernel. Only returned when eval_gradient
          is True.
      """
      if eval_gradient:
          K1, K1_gradient = self.k1(
              X, Y, eval_gradient=True, active=active
          )
          K2, K2_gradient = self.k2(
              X, Y, eval_gradient=True, active=active
          )
  
          return K1 * K2, np.dstack(
              (
                  K1_gradient * K2[:, :, np.newaxis],
                  K2_gradient * K1[:, :, np.newaxis],
              )
          )
      else:
          return self.k1(X, Y, active=active) * self.k2(
              X, Y, active=active
          )
  
imports: from __future__ import annotations
  from abc import abstractmethod
  from typing import Any, Callable
  from inspect import Signature, signature
  import numpy
  import sklearn.gaussian_process.kernels
  from smac.model.gaussian_process.priors.abstract_prior import AbstractPrior
  from smac.utils.configspace import get_conditional_hyperparameters
label_desc: Use image node_id 2 for calling the ProductKernel obj's underlying member method code with example usage: obj.__call__(X, Y, eval_gradient, active) and returns: unknown,  np, unknown