I guess the cause is somehow related to OpenMP. Would you please add MKL to build to verify my hypothesis? As for the installation script, you can refer to https://github.com/pytorch/builder/blob/master/windows/build_pytorch.bat#L68-L73 38.
Update:
A fast way to do that verification is to run the following code before importing torch:
import ctypes
ctypes.CDLL(r"C:\Windows\System32\vcomp140.dll")

If this fixes your problem, then the DLL from Anaconda C:\dev\anaconda\vcomp140.dll may be incompatible.