class_docstr: Abstract class implementing quadrature methods to compute Gaussian Expectations.
  Inheriting classes must provide the method _build_X_W to create points and weights
  to be used for quadrature.
docstr: Compute the Gaussian Expectation of a function f::
  
      X ~ N(mean, var)
      E[f(X)] = ∫f(x, *args, **kwargs)p(x)dx
  
  Using the formula::
  
      E[f(X)] = sum_{i=1}^{N_quad_points} f(x_i) * w_i
  
  where x_i, w_i must be provided by the inheriting class through self._build_X_W.
  
  :param fun: Callable or Iterable of Callables that operates elementwise, with
      signature f(X, \*args, \*\*kwargs). Moreover, it must satisfy the shape-mapping::
  
          X shape: [N_quad_points, batch..., d].
          f(X) shape: [N_quad_points, batch..., broadcast d].
  
      In most cases, f should only operate over the last dimension of X
  :param mean: Array/Tensor representing the mean of a d-Variate Gaussian distribution
  :param var: Array/Tensor representing the variance of a d-Variate Gaussian distribution
  :param args: Passed to fun
  :param kargs: Passed to fun
  :return: Gaussian expectation of fun
code: def __call__(
      self,
      fun: Union[
          Callable[..., tf.Tensor], Iterable[Callable[..., tf.Tensor]]
      ],
      mean: TensorType,
      var: TensorType,
      *args: Any,
      **kwargs: Any,
  ) -> tf.Tensor:
      r"""
      Compute the Gaussian Expectation of a function f::
  
          X ~ N(mean, var)
          E[f(X)] = ∫f(x, *args, **kwargs)p(x)dx
  
      Using the formula::
  
          E[f(X)] = sum_{i=1}^{N_quad_points} f(x_i) * w_i
  
      where x_i, w_i must be provided by the inheriting class through self._build_X_W.
  
      :param fun: Callable or Iterable of Callables that operates elementwise, with
          signature f(X, \*args, \*\*kwargs). Moreover, it must satisfy the shape-mapping::
  
              X shape: [N_quad_points, batch..., d].
              f(X) shape: [N_quad_points, batch..., broadcast d].
  
          In most cases, f should only operate over the last dimension of X
      :param mean: Array/Tensor representing the mean of a d-Variate Gaussian distribution
      :param var: Array/Tensor representing the variance of a d-Variate Gaussian distribution
      :param args: Passed to fun
      :param kargs: Passed to fun
      :return: Gaussian expectation of fun
      """
  
      X, W = self._build_X_W(mean, var)
      if isinstance(fun, Iterable):
          return [
              tf.reduce_sum(f(X, *args, **kwargs) * W, axis=0)
              for f in fun
          ]
      return tf.reduce_sum(fun(X, *args, **kwargs) * W, axis=0)
  
file_path: GPflow/gpflow/quadrature/base.py
imports: import abc
  from typing import Any, Callable, Iterable, Tuple, Union
  import tensorflow
  from check_shapes import check_shapes
  from ..base import TensorType
label_desc: Use image node_id 2 for calling the GaussianQuadrature obj's underlying member method code with example usage: obj.__call__(fun, mean, var) and returns: tf, unknown