code: def test_masked_emission_matrix(model, X, X_masked):
      X = torch.tensor(numpy.array(X))
      mask = torch.ones_like(X).type(torch.bool)
      X_ = torch.masked.MaskedTensor(X, mask=mask)
  
      e = model._emission_matrix(X_)
  
      assert_array_almost_equal(
          e,
          [
              [-4.7349, -4.8411],
              [-7.5921, -3.9838],
              [-21.4016, -5.4276],
              [-25.2111, -6.4169],
              [-2.3540, -5.8519],
              [-43.3063, -9.0034],
              [-1.8778, -5.1852],
              [-18.0682, -5.1051],
              [-1.4016, -4.5185],
              [-14.2587, -4.6290],
              [2.4079, -3.5293],
          ],
          4,
      )
  
      d = [Exponential([2.1, 0.3, 0.1]), Exponential([1.5, 3.1, 2.2])]
      model = BayesClassifier(d)
      e = model._emission_matrix(X_masked)
  
      assert_array_almost_equal(
          e,
          [
              [-3.8533, -3.2582],
              [-0.2311, -2.2300],
              [-0.6931, -0.6931],
              [-25.5476, -5.9061],
              [-2.8225, -2.1471],
              [-43.6428, -8.4926],
              [-0.6931, -0.6931],
              [-19.6087, -3.4628],
              [-1.7381, -4.0077],
              [-14.5952, -4.1182],
              [0.8675, -1.8871],
          ],
          4,
      )
  
imports: import os
  import numpy
  import torch
  import pytest
  from pomegranate.bayes_classifier import BayesClassifier
  from pomegranate.distributions import Exponential
  from .distributions._utils import _test_initialization_raises_one_parameter
  from .distributions._utils import _test_initialization
  from .distributions._utils import _test_predictions
  from .distributions._utils import _test_efd_from_summaries
  from .distributions._utils import _test_raises
  from nose.tools import assert_raises
  from numpy.testing import assert_array_almost_equal
label_desc: Use image node_id 39 for calling a global function with example usage: test_masked_emission_matrix(model, X, X_masked) without return types