code: def test_quadrature_autograph() -> None:
      """
      Check that the return value is equal with and without Autograph
      Regression test for https://github.com/GPflow/GPflow/issues/1547.
      """
  
      def compute(autograph: bool) -> AnyNDArray:
          @tf.function(autograph=autograph)
          def func() -> tf.Tensor:
              mu: AnyNDArray = np.array([1.0, 1.3])
              var: AnyNDArray = np.array([3.0, 3.5])
              num_gauss_hermite_points = 25
              return quadrature.ndiagquad(
                  [lambda *X: tf.exp(X[0])],
                  num_gauss_hermite_points,
                  [mu],
                  [var],
              )
  
          (result,) = func()
          return cast(AnyNDArray, result.numpy())
  
      np.testing.assert_equal(
          compute(autograph=True),
          compute(autograph=False),
      )
  
file_path: GPflow/tests/gpflow/quadrature/test_quadrature.py
imports: from typing import cast
  import numpy
  import pytest
  import tensorflow
  from numpy.testing import assert_allclose
  import gpflow.quadrature
  from gpflow.base import AnyNDArray, TensorType
label_desc: Use image node_id 6 for calling a global function with example usage: test_quadrature_autograph() and returns: cast, quadrature