code: def test_pinverse(self):
      mat = np.random.randn(5, 5)
      np_inv = np.linalg.pinv(mat)
      inv = pinverse(torch.tensor(mat))
      npt.assert_array_almost_equal(np_inv, inv.numpy())
  
file_path: pgmpy/pgmpy/tests/test_utils/test_optimizer.py
imports: import unittest
  import numpy
  import numpy.testing
  import torch
  from pgmpy import config
  from pgmpy.utils import optimize, pinverse
label_desc: Use image node_id 1 for calling the Testpinverse obj's underlying member method code with example usage: obj.test_pinverse() without return types