I never know, but it would seem that PyTorch should generate a number of .cpps as well:
  

      github.com
  

  
    pytorch/pytorch/blob/773c8b6440eee7d903f3d3a80d1fa866370b1ba2/caffe2/CMakeLists.txt#L365 2



      
      
          
          
# Generate header with version info
          configure_file("${TORCH_SRC_DIR}/csrc/api/include/torch/version.h.in"
            "${TORCH_SRC_DIR}/csrc/api/include/torch/version.h"
            @ONLY)
          
          
set(GENERATED_CXX_TORCH
            "${TORCH_SRC_DIR}/csrc/autograd/generated/Functions.cpp"
            )
          
          
if(NOT INTERN_DISABLE_AUTOGRAD AND NOT BUILD_LITE_INTERPRETER)
            list(APPEND GENERATED_CXX_TORCH
              "${TORCH_SRC_DIR}/csrc/autograd/generated/VariableType_0.cpp"
              "${TORCH_SRC_DIR}/csrc/autograd/generated/VariableType_1.cpp"
              "${TORCH_SRC_DIR}/csrc/autograd/generated/VariableType_2.cpp"
              "${TORCH_SRC_DIR}/csrc/autograd/generated/VariableType_3.cpp"
              "${TORCH_SRC_DIR}/csrc/autograd/generated/VariableType_4.cpp"
              "${TORCH_SRC_DIR}/csrc/autograd/generated/TraceType_0.cpp"
              "${TORCH_SRC_DIR}/csrc/autograd/generated/TraceType_1.cpp"
              "${TORCH_SRC_DIR}/csrc/autograd/generated/TraceType_2.cpp"
              "${TORCH_SRC_DIR}/csrc/autograd/generated/TraceType_3.cpp"