DataWrapper
- class omni.graph.core.DataWrapper(memory: int, dtype: ~omni.graph.core._impl.dtypes.Dtype, shape: None | int | tuple[int, int] | tuple[tuple[int, int]] | tuple[tuple[int, int], int] | tuple[int, int, int] | tuple[int, int, tuple[int, int]], device: ~omni.graph.core._impl.data_wrapper.Device, gpu_ptr_kind: ~omni.graph.core._omni_graph_core.PtrToPtrKind = <PtrToPtrKind.NA: 0>)
Bases:
object
Wrapper around typed memory data.
This class provides no functionality for manipulating the data, only for inspecting it and extracting it for other code to manipulate it. e.g. you could extract CPU data as a numpy array and modify values, though you cannot change its size, or you could extract the pointer to the GPU data for passing in to a GPU-aware package like TensorFlow. External functions will perform these conversions.
- memory
Address of the data in the memory space
- dtype
Data type information for the individual data elements
- shape
Array shape of the memory
- device
Device on which the memory is located.
- gpu_ptr_kind
Arrays of GPU pointers can either be on the GPU or the CPU, depending on where you want to reference them. If the shape is an array and device is cuda then this tells where ‘memory’ lives
Methods
__init__
(memory, dtype, shape, device[, ...])Sets up the wrapper for the passed-in data.
is_array
()Checks to see if the data wrapped type is an array
- __init__(memory: int, dtype: ~omni.graph.core._impl.dtypes.Dtype, shape: None | int | tuple[int, int] | tuple[tuple[int, int]] | tuple[tuple[int, int], int] | tuple[int, int, int] | tuple[int, int, tuple[int, int]], device: ~omni.graph.core._impl.data_wrapper.Device, gpu_ptr_kind: ~omni.graph.core._omni_graph_core.PtrToPtrKind = <PtrToPtrKind.NA: 0>)
Sets up the wrapper for the passed-in data.
- Parameters
memory – Integer containing the memory address of the data
dtype – Data type of the referenced data
shape – Array shape of the referenced data
device – Device on which the memory is located.
gpu_ptr_kind – Location of pointers that point to GPU arrays
- is_array() bool
Checks to see if the data wrapped type is an array
- Returns
True iff the data shape indicates that it is an arbitrary sized array of some kind
- Return type
bool