What is TORCH_API?

Found here for example: https://github.com/pytorch/pytorch/blob/6084908287ab88b73f8af8d6469aac0c57cb1b43/torch/csrc/jit/fuser/interface.h#L19

These macros are used to properly set the visibility of the cpp functions. In particular, by default, functions won’t be exposed in the shared library. Adding this macro will make them available.

1 Like