Skip to content

Commit 006c492

Browse files
committed
improve docs
1 parent f69e0c5 commit 006c492

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

docs/npoptix_config.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Start, configure, get output
1818
.. automethod:: plotoptix.NpOptiX._run_event_loop
1919
.. automethod:: plotoptix.NpOptiX.run
2020
.. automethod:: plotoptix.NpOptiX.get_gpu_architecture
21+
.. automethod:: plotoptix.NpOptiX.enable_torch
2122

2223
Scene configuration
2324
-------------------
@@ -126,7 +127,9 @@ GPU variables related to the raytracer general configuraton are documented below
126127
.. automethod:: plotoptix.NpOptiX.get_float
127128
.. automethod:: plotoptix.NpOptiX.get_float2
128129
.. automethod:: plotoptix.NpOptiX.get_float3
130+
.. automethod:: plotoptix.NpOptiX.set_torch_texture_1d
129131
.. automethod:: plotoptix.NpOptiX.set_texture_1d
132+
.. automethod:: plotoptix.NpOptiX.set_torch_texture_2d
130133
.. automethod:: plotoptix.NpOptiX.set_texture_2d
131134
.. automethod:: plotoptix.NpOptiX.load_texture
132135

plotoptix/npoptix.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ def __del__(self):
278278

279279
def enable_torch(self):
280280
"""Enable pytorch features.
281+
282+
Required before any call to PyTorch related methods:
283+
:meth:`plotoptix.NpOptiX.set_torch_texture_1d`, :meth:`plotoptix.NpOptiX.set_torch_texture_2d`,
284+
or :meth:`plotoptix.NpOptiX.update_raw_data` with torch tensor used.
285+
281286
"""
282287
import importlib
283288
try:
@@ -1197,6 +1202,10 @@ def set_torch_texture_1d(self, name: str, data: Any,
11971202
Store texture data copy in the host memory.
11981203
refresh : bool, optional
11991204
Set to ``True`` if the image should be re-computed.
1205+
1206+
See Also
1207+
--------
1208+
:meth:`plotoptix.NpOptiX.enable_torch`
12001209
"""
12011210
if self._torch is None:
12021211
self._logger.error("Torch features are not enabled, use rt.enable_torch() first.")
@@ -1382,6 +1391,10 @@ def set_torch_texture_2d(self, name: str, data: Any,
13821391
Store texture data copy in the host memory.
13831392
refresh : bool, optional
13841393
Set to ``True`` if the image should be re-computed.
1394+
1395+
See Also
1396+
--------
1397+
:meth:`plotoptix.NpOptiX.enable_torch`
13851398
"""
13861399

13871400
if self._torch is None:
@@ -4494,6 +4507,7 @@ def update_raw_data(self, name: str,
44944507
44954508
See Also
44964509
--------
4510+
:meth:`plotoptix.NpOptiX.enable_torch`
44974511
:meth:`plotoptix.NpOptiX.update_data`
44984512
:meth:`plotoptix.NpOptiX.get_data`
44994513
"""

0 commit comments

Comments
 (0)