Solved by haridas_n in post #2 
              
              
                The problem here was, I wasn’t importing the pytorch library before the extension. ie; 
import torch
import test_ext
import unittest

class TestLib(unittest.TestCase):
    def test_matrix_mal(self):
        mm = test_ext.MatrixMultiplier(3, 4)
        mm.get()

import torch has to be done before imp…