Solved by DBraun in post #11 
              
              
                It was an issue with DLLs… 
TouchDesigner has its own DLLs in C:/Program Files/Derivative/TouchDesigner/bin. These DLLs get loaded when TouchDesigner opens. 
My custom plugin is in Documents/Derivative/Plugins and all of the libtorch DLLs are also there. My thought was that having everything in this…