Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dusty-nv committed May 2, 2023
1 parent 718e21a commit 28b3aad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/aux-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ This enables the GPU memory from the cudaImage to be used by PyTorch GPU tensors

### Sharing the Memory Pointer

For libraries that don't support one of the above interfaces, cudaImage exposes the raw data pointer of it's memory through the `.ptr` attribute, which can be used to import it into other data structures without copying it. Conversely, the cudaImage initializer also accepts an optional `ptr` argument that can be set to an externally-allocated buffer - in this case, cudaImage will share the memory instead allocating it's own.
For libraries that don't support one of the above interfaces, cudaImage exposes the raw data pointer of it's memory through it's `.ptr` attribute, which can be used to import it into other data structures without copying it. Conversely, the cudaImage initializer also has a `ptr` argument that can be set to an externally-allocated buffer - in this case, cudaImage will share the memory instead allocating it's own.

An example of doing this is mapping an existing PyTorch GPU tensor to a cudaImage:
See [`cuda-from-pytorch.py`](https://github.com/dusty-nv/jetson-utils/blob/master/python/examples/cuda-from-pytorch.py) for an example of doing this, that maps an existing PyTorch GPU tensor to a cudaImage:

``` python
import torch
Expand Down

0 comments on commit 28b3aad

Please sign in to comment.