You need all these DLL’s inside the folder where mnist.exe is:
file(COPY "${DLL_3RD}/torch.dll" DESTINATION ${CMAKE_BINARY_DIR})
file(COPY "${DLL_3RD}/hdf5.dll" DESTINATION ${CMAKE_BINARY_DIR})
file(COPY "${DLL_3RD}/opencv_world400.dll" DESTINATION ${CMAKE_BINARY_DIR})
file(COPY "${DLL_3RD}/zlib.dll" DESTINATION ${CMAKE_BINARY_DIR})
file(COPY "${DLL_3RD}/caffe2_gpu.dll" DESTINATION ${CMAKE_BINARY_DIR})
file(COPY "${DLL_3RD}/nvToolsExt64_1.dll" DESTINATION ${CMAKE_BINARY_DIR})
file(COPY "${DLL_3RD}/c10_cuda.dll" DESTINATION ${CMAKE_BINARY_DIR})

This is for the CUDA version.