Class GXFTensor
Defined in File gxf_tensor.hpp
Base Type
public nvidia::gxf::Tensor
-
class GXFTensor : public nvidia::gxf::Tensor
Class to wrap GXF Tensor holding DLPack tensor structure.
Public Functions
- GXFTensor() = default
-
GXFTensor(nvidia::gxf::Tensor &tensor)
Construct a new GXFTensor object.
This constructor is used to wrap a GXF Tensor object. The given nvidia::gxf::Tensor object is modified to point to the shared memory buffer so that the memory buffer is shared between the GXF’s Tensor object and the GXFTensor object.
- Parameters
tensor – Tensor to wrap.
Construct a new GXFTensor object.
- Parameters
dl_ctx – DLManagedTensorCtx object to wrap.
-
DLDevice device() const
Get DLDevice object from the GXF Tensor.
- Returns
DLDevice object.
-
DLDataType dtype() const
Get DLDataType object from the GXF Tensor.
- Returns
DLDataType object.
-
std::shared_ptr<holoscan::Tensor> as_tensor()
Convert GXF Tensor to Holoscan Tensor.
- Returns
holoscan::Tensor object converted from GXF Tensor.
-
inline std::shared_ptr<DLManagedTensorCtx> &dl_ctx()
Get the internal DLManagedTensorCtx of the GXFTensor.
- Returns
A shared pointer to the Tensor’s DLManagedTensorCtx.
Public Static Functions
Protected Attributes
- std::shared_ptr<DLManagedTensorCtx> dl_ctx_