code: def _expectation_diagonal_product_inducingpoints__product_inducingpoints(
      p: DiagonalGaussian,
      kern1: kernels.Product,
      feat1: InducingPoints,
      kern2: kernels.Product,
      feat2: InducingPoints,
      nghp: None = None,
  ) -> tf.Tensor:
      r"""
      Compute the expectation:
      expectation[n] = < prodK_{Z, x_n} prodK_{x_n, Z} >_p(x_n)
                     = < (\HadamardProd_i Ki_{Z[:, active_dims_i], x[n, active_dims_i]})  <-- Mx1
                 1xM -->  (\HadamardProd_j Kj_{x[n, active_dims_j], Z[:, active_dims_j]}) >_p(x_n)  (MxM)
  
          - \HadamardProd_i Ki_{.,.}, \HadamardProd_j Kj_{.,.} :: Product kernels
          - p                        :: DiagonalGaussian distribution (p.cov NxD)
  
      :return: NxMxM
      """
      if feat1 != feat2:
          raise NotImplementedError(
              "Different inducing variables are not supported."
          )
      if kern1 != kern2:
          raise NotImplementedError(
              "Calculating the expectation over two "
              "different Product kernels is not supported."
          )
  
      kernel = kern1
      inducing_variable = feat1
  
      if not kernel.on_separate_dimensions:
          raise NotImplementedError(
              "Product currently needs to be defined on separate dimensions."
          )  # pragma: no cover
  
      exps = [
          expectation(
              p,
              (k, inducing_variable),
              (k, inducing_variable),
              nghp=nghp,
          )
          for k in kernel.kernels
      ]
      return reduce(tf.multiply, exps)
  
file_path: GPflow/gpflow/expectations/products.py
imports: from functools import reduce
  from typing import Type
  import tensorflow
  from check_shapes import check_shapes
  from ..None import kernels
  from ..inducing_variables import InducingPoints
  from ..probability_distributions import DiagonalGaussian
  from .None import dispatch
  from .expectations import expectation
label_desc: Use image node_id 3 for calling a global function with example usage: _expectation_diagonal_product_inducingpoints__product_inducingpoints(p, kern1, feat1, kern2, feat2, nghp) and returns: reduce