code: def test_hmm_summarize(hmm, X, priors):
      X = numpy.array([X])
      priors = priors.unsqueeze(0)
  
      y_hat = hmm.summarize(X)
      assert_array_almost_equal(hmm._xw_starts_sum, [0.0969, 0.9031], 4)
      assert_array_almost_equal(hmm._xw_ends_sum, [0.9908, 0.0092], 4)
      assert_array_almost_equal(
          hmm._xw_sum,
          [[1.8028e-03, 2.2629e00], [3.1568e00, 4.5785e00]],
          4,
      )
  
      y_hat = hmm.summarize(X, priors=priors)
      assert_array_almost_equal(hmm._xw_starts_sum, [0.1938, 1.8062], 4)
      assert_array_almost_equal(hmm._xw_ends_sum, [1.9893, 0.0107], 4)
      assert_array_almost_equal(
          hmm._xw_sum, [[1.0017, 3.9185], [5.714, 9.3657]], 4
      )
  
imports: import os
  import numpy
  import torch
  import pytest
  from pomegranate.gmm import GeneralMixtureModel
  from pomegranate.hmm import DenseHMM
  from pomegranate.distributions import Exponential
  from nose.tools import assert_raises
  from numpy.testing import assert_array_equal
  from numpy.testing import assert_array_almost_equal
label_desc: Use image node_id 41 for calling a global function with example usage: test_hmm_summarize(hmm, X, priors) without return types