Skip to content

Tutorial Error for "Using the PyTorch C++ Frontend" #31037

@lzxzy

Description

@lzxzy

📚 Documentation

Hi, when I try to follow the tutorial Using the PyTorch C++ Frontend. At the beginning of the article,the toy example CMakeLists.txt was written like this:

cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(dcgan)

find_package(Torch REQUIRED)

add_executable(dcgan dcgan.cpp)
target_link_libraries(dcgan "${TORCH_LIBRARIES}")
set_property(TARGET dcgan PROPERTY CXX_STANDARD 11)

But I get the error error: #error You need C++14 to compile PyTorch.
I guess in the latest libtorch version, you may use some C++ 14 features. So, I change the last line in CMakeLists.txt to set_property(TARGET dcgan PROPERTY CXX_STANDARD 14). It worked. I think we should make some updates for this tutorial.

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: docsRelated to our documentation, both in docs/ and docblockstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions