Also, do you have this in your Cmake?
set(Torch_DIR f:/libtorch_gpu/share/cmake/Torch/)
FIND_PACKAGE(Torch REQUIRED)

find_package(CUDA REQUIRED)
if(CUDA_FOUND)
    # There is some bug in CMake (FindCUDA.cmake) that causes it to mess up the -std=c++11 option
    # if you let it propagate it to nvcc in some cases.
    if(NOT MSVC)
        set(CUDA_PROPAGATE_HOST_FLAGS OFF)
        list(APPEND CUDA_NVCC_FLAGS -std=c++11)
    endif()
endif()