class_docstr: A likelihood class that helps with scalar likelihood functions: likelihoods where
  each scalar latent function is associated with a single scalar observation variable.
  
  If there are multiple latent functions, then there must be a corresponding number of data: we
  check for this.
  
  The `Likelihood` class contains methods to compute marginal statistics of functions
  of the latents and the data ϕ(y,x,f):
  
  * variational_expectations:  ϕ(y,x,f) = log p(y|x,f)
  * predict_log_density: ϕ(y,x,f) = p(y|x,f)
  
  Those statistics are computed after having first marginalized the latent processes f
  under a multivariate normal distribution q(x,f) that is fully factorized.
  
  Some univariate integrals can be done by quadrature: we implement quadrature routines for 1D
  integrals in this class, though they may be overwritten by inheriting classes where those
  integrals are available in closed form.
class_docstr_tok: ["A","likelihood","class","that","helps","with","scalar","likelihood","functions",":","likelihoods","where","each","scalar","latent","function","is","associated","with","a","single","scalar","observation","variable",".","If","there","are","multiple","latent","functions",",","then","there","must","be","a","corresponding","number","of","data",":","we","check","for","this",".","The","`","Likelihood","`","class","contains","methods","to","compute","marginal","statistics","of","functions","of","the","latents","and","the","data","\u03d5","(","y",",","x",",","f",")",":","*","variational_expectations",":","\u03d5","(","y",",","x",",","f",")","=","log","p","(","y|x",",","f",")","*","predict_log_density",":","\u03d5","(","y",",","x",",","f",")","=","p","(","y|x",",","f",")","Those","statistics","are","computed","after","having","first","marginalized","the","latent","processes","f","under","a","multivariate","normal","distribution","q","(","x",",","f",")","that","is","fully","factorized",".","Some","univariate","integrals","can","be","done","by","quadrature",":","we","implement","quadrature","routines","for","1D","integrals","in","this","class",",","though","they","may","be","overwritten","by","inheriting","classes","where","those","integrals","are","available","in","closed","form","."]
docstr: Quadrature is over the latent dimensions. Generally, this is equal to
  self.latent_dim. This separate property allows the ScalarLikelihood
  subclass to override it with 1 (broadcasting over observation/latent
  dimensions instead).
docstr_tok: ["Quadrature","is","over","the","latent","dimensions",".","Generally",",","this","is","equal","to","self.latent_dim",".","This","separate","property","allows","the","ScalarLikelihood","subclass","to","override","it","with","1","(","broadcasting","over","observation\/latent","dimensions","instead",")","."]
code: def _quadrature_dim(self) -> int:
      """
      Quadrature is over the latent dimensions. Generally, this is equal to
      self.latent_dim. This separate property allows the ScalarLikelihood
      subclass to override it with 1 (broadcasting over observation/latent
      dimensions instead).
      """
      return 1
  
imports: import abc
  from typing import Any, Callable, Iterable, Optional, Sequence, Union
  import tensorflow
  from check_shapes import check_shapes, inherit_check_shapes
  from ..base import MeanAndVariance, Module, TensorType
  from ..quadrature import GaussianQuadrature, NDiagGHQuadrature, ndiag_mc
label_desc: Use image node_id 4 for calling the ScalarLikelihood obj's underlying member method code with example usage: obj._quadrature_dim() and returns: int