code: def test_log_probability(X, alphas):
      x = [[0.0], [2.0], [8.0], [0.0], [1.9]]
      y = [0.0, NEGINF, NEGINF, 0.0, NEGINF]
  
      d1 = DiracDelta([1.0])
  
      _test_predictions(x, y, d1.log_probability(x), torch.float32)
  
      x = [[1.0, 2.0, 4], [0.0, 0.0, 0.0]]
      y = [NEGINF, numpy.log(numpy.prod(alphas))]
  
      d1 = DiracDelta(alphas)
      d2 = DiracDelta(numpy.array(alphas, dtype=numpy.float64))
  
      _test_predictions(x, y, d1.log_probability(x), torch.float32)
      _test_predictions(x, y, d2.log_probability(x), torch.float64)
  
      p = [1, 2, 4]
      x = [[1, 2, 1], [2, 2, 1], [0, 0, 0], [0, 0, 2]]
      y = [NEGINF, NEGINF, numpy.log(numpy.prod(p)), NEGINF]
  
      d1 = DiracDelta(p)
      d2 = DiracDelta(numpy.array(p, dtype=numpy.float64))
  
      _test_predictions(x, y, d1.log_probability(x), torch.float32)
      _test_predictions(x, y, d2.log_probability(x), torch.float64)
  
      p = [1.0, 2.0, 4.0]
      d1 = DiracDelta(p)
      d2 = DiracDelta(numpy.array(p, dtype=numpy.float64))
      _test_predictions(x, y, d1.log_probability(x), torch.float32)
      _test_predictions(x, y, d2.log_probability(x), torch.float64)
  
imports: import os
  import numpy
  import torch
  import pytest
  from pomegranate.distributions import DiracDelta
  from ._utils import _test_initialization_raises_one_parameter
  from ._utils import _test_initialization
  from ._utils import _test_predictions
  from ._utils import _test_efd_from_summaries
  from ._utils import _test_raises
  from nose.tools import assert_raises
  from numpy.testing import assert_array_almost_equal
label_desc: Use image node_id 12 for calling a global function with example usage: test_log_probability(X, alphas) without return types