Create a custom predict function

I am training a model using pytorch and i want to use the weights learned to create a custom predict function. I am using a custom module for matrix multiplication i want to test the module for prediction, the module does not support tensors, so can is it possble to get the weights as numpy arrays. ?

Yes, you can access the .weight attribute and transform them to numpy arrays e.g. via:

arr = model.layer.weight.cpu().numpy()