Hi all,
First off - Having a Great time with pytorch, and it’s working well with UnrealEngine 4.23 - but with performance in mind…
I’m trying to build libtorch with UE4 - but running into some issues during compilation
Error	C4273	'torch::jit::tracer::addInputs': inconsistent dll linkage	UETorchC	E:\UETorchC\Source\ThirdParty\libtorch\include\torch\csrc\jit\tracer.h	292	
Error	C4273	'torch::jit::tracer::addInputs': inconsistent dll linkage	UETorchC	E:\UETorchC\Source\ThirdParty\libtorch\include\torch\csrc\jit\tracer.h	299	
Error	C2280	'std::shared_ptr<Contained> std::dynamic_pointer_cast<Derived,_Ty>(std::shared_ptr<_Ty> &&) noexcept': attempting to reference a deleted function	UETorchC	E:\UETorchC\Source\ThirdParty\libtorch\include\torch\csrc\api\include\torch\nn\cloneable.h	85	


I’m on win10, using VS2019 (which calls UBT - unreals own build system instead of using its own, but still compiles with MSVC)
What I have tried:

building using libtorch 1.4 release, 1.4 debug, and latest debug
surpressing errors using pragma __pragma(warning(disable: 4273))

enabling permissive mode
linking to only the libs, dlls, both or neither (This actually seems to have no effect)
ensuring the build path has no spaces

The only ideas I really have left are to use vs2017 or try building libtorch from source, but not too confident either option will work.
Any ideas? I am happy to provide any more details or share the project.
Thanks!