This is the code for the PyTorch extension for 3D Slicer.
Its main function is to install PyTorch inside Slicer. The latest version compatible with the installed drivers will be selected automatically.
PyTorch can be installed opening the PyTorch Utils module and clicking on the button, or programmatically:
import PyTorchUtils
torch = PyTorchUtils.PyTorchUtilsLogic().torch # will be installed if necessary
tensor = torch.rand(50, 60)Here's a diagram of the integration between PyTorch and Slicer:
