IOLink 1.16.1
Loading...
Searching...
No Matches
iolink::TensorViewFactory Class Reference

Static Public Member Functions

static std::shared_ptr< TensorViewallocate (const VectorXu64 &shape, DataType dtype)
 Allocate a new tensor in memory with the given shape and data type.
 
static std::shared_ptr< TensorViewfromImage (const std::shared_ptr< ImageView > &src)
 Create a TensorView from an ImageView.
 
static std::shared_ptr< TensorViewfromDataFrame (const std::shared_ptr< DataFrameView > &src)
 Create a TensorView from a DataFrameView.
 

Member Function Documentation

◆ allocate()

static std::shared_ptr< TensorView > iolink::TensorViewFactory::allocate ( const VectorXu64 shape,
DataType  dtype 
)
static

Allocate a new tensor in memory with the given shape and data type.

Parameters
shapeThe shape of the tensor to allocate.
dtypeThe data type of the tensor to allocate.
Returns
A shared pointer to the allocated TensorView.

◆ fromDataFrame()

static std::shared_ptr< TensorView > iolink::TensorViewFactory::fromDataFrame ( const std::shared_ptr< DataFrameView > &  src)
static

Create a TensorView from a DataFrameView.

This method adapts the DataFrameView to a TensorView, allowing the data in the DataFrame to be accessed as a tensor.

Parameters
srcThe source DataFrameView to adapt.
Returns
A shared pointer to the adapted TensorView.
Exceptions
InvalidArgumentIf the source DataFrameView is invalid or if its columns do not have the same data type.

◆ fromImage()

static std::shared_ptr< TensorView > iolink::TensorViewFactory::fromImage ( const std::shared_ptr< ImageView > &  src)
static

Create a TensorView from an ImageView.

This method adapts the ImageView to a TensorView, allowing the image data to be accessed as a tensor.

Parameters
srcThe source ImageView to adapt.
Returns
A shared pointer to the adapted TensorView.
Exceptions
InvalidArgumentIf the source ImageView is invalid.

The documentation for this class was generated from the following file: