code: def _test_initialization(d, x, inertia, frozen, dtype):
      assert d.inertia == inertia
      assert d.frozen == frozen
  
      if d._initialized:
          assert len(d.probs) == len(x)
  
          if isinstance(x, torch.Tensor):
              assert d.probs[0].shape == x[0].shape
              assert d.probs[0].dtype == x[0].dtype
  
          for i in range(len(d.probs)):
              assert_array_almost_equal(d.probs[i], x[i])
  
imports: import numpy
  import torch
  import pytest
  from pomegranate.distributions import ConditionalCategorical
  from ._utils import _test_initialization_raises_one_parameter
  from ._utils import _test_initialization
  from ._utils import _test_predictions
  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 4 for calling a global function with example usage: _test_initialization(d, x, inertia, frozen, dtype) without return types