File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -284,15 +284,16 @@ three ways:
284
284
285
285
1. The first way to load the C++ library that holds the custom operator definition
286
286
is to define a dummy Python module for _C. Then, in Python, when you import the
287
- module with ``import _C ``, the ``.so``s corresponding to the extension will be
288
- loaded and the ``TORCH_LIBRARY `` and ``TORCH_LIBRARY_IMPL `` static initializers
287
+ module with ``import _C ``, the ``.so `` files corresponding to the extension will
288
+ be loaded and the ``TORCH_LIBRARY `` and ``TORCH_LIBRARY_IMPL `` static initializers
289
289
will run. One can create a dummy Python module with ``PYBIND11_MODULE `` like below,
290
290
but you will notice that this does not compile with ``Py_LIMITED_API ``, because
291
291
``pybind11 `` does not promise to only use the stable limited CPython API! With
292
292
the below code, you sadly cannot build a CPython agnostic wheel for your extension!
293
- (Foreshadowing: I wonder what the second way is ;)).
293
+ (Foreshadowing: I wonder what the second way is ;) ).
294
294
295
295
.. code-block :: cpp
296
+
296
297
// in, say, not_agnostic/csrc/extension_BAD.cpp
297
298
#include <pybind11/pybind11.h>
298
299
@@ -312,6 +313,7 @@ three ways:
312
313
for more details:
313
314
314
315
.. code-block :: cpp
316
+
315
317
#include <Python.h>
316
318
317
319
extern "C" {
You can’t perform that action at this time.
0 commit comments