Error: no matching function for call to custom class

I tried to compiler Nvidia fastertransformer, i got so file when compiling custom c++ function, but got error when compiling custom c++ class:

error: no matching function for call to ‘torch::class_<torch_ths::FasterTransformerEncoder>::class_(const char [25])’
   torch::jit::class_<torch_ths::FasterTransformerEncoder>("FasterTransformerEncoder")

I searched for the reason, some search results told me it may be environment problem, but i don’t know the exact reason, my environment is:

  • Pytorch 1.6
  • CUDA 10.2
  • GCC 7.5.0
  • CMake 3.18.0-rc3
  • Centos 7
    And -DCXX_STD=14 in cmake command

The error seems to be created by a custom function, so you might get better help by creating an issue in their GitHub repository and ask the author, if she’s seen it before.

Could you post the links to your search results suggesting it’s an env issue?

Hi, thank you for your response, and the author help me slove this problem.
The result is the custom function for pytorch in nvidia docker is not same as which in public pytorch.