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

where is this macro’s definition?

Here it is: pytorch/Export.h at 0fe5367058a1d67134aee510ed81691cf9e61e33 · pytorch/pytorch · GitHub