IOLink C# 1.16.1
Loading...
Searching...
No Matches
IOLink.TensorView Class Reference

A model of a tensor. More...

Inheritance diagram for IOLink.TensorView:
IOLink.View

Public Member Functions

 TensorView (global::System.IntPtr cPtr, bool cMemoryOwn)
 
virtual TensorCapabilitySet GetCapabilities ()
 Get the capabilities of the tensor.
 
bool Support (TensorCapabilitySet capabilities)
 Shortcut to check if capabilities are supported by the tensor.
 
virtual VectorXu64 GetShape ()
 Get the shape of the tensor.
 
uint GetDimensionCount ()
 Shortcut to get the number of dimensions of the tensor.
 
virtual DataType GetDtype ()
 Get the data type of the tensor.
 
string ToString ()
 Return a string representation.
 
unsafe void Read (RegionXu64 region, byte[] dst)
 Read data from a given region into a destination buffer.
 
unsafe void Write (RegionXu64 region, byte[] src)
 Write data from a source buffer into a given region of the tensor.
 
virtual void Reshape (VectorXu64 shape, DataType dtype)
 

Static Public Member Functions

static global::System.Runtime.InteropServices.HandleRef getCPtr (TensorView obj)
 

Protected Member Functions

override void Dispose (bool disposing)
 

Properties

TensorCapabilitySet Capabilities [get]
 
VectorXu64 Shape [get]
 
uint DimensionCount [get]
 
DataType Dtype [get]
 

Detailed Description

A model of a tensor.

Tensors are simple multidimensional arrays that can be used to represent data in a structured way. They can be used to represent images, audio, text, or any other type of data that can be represented as a multidimensional array.

Member Function Documentation

◆ Dispose()

override void IOLink.TensorView.Dispose ( bool  disposing)
inlineprotectedvirtual

Reimplemented from IOLink.View.

◆ GetCapabilities()

virtual TensorCapabilitySet IOLink.TensorView.GetCapabilities ( )
inlinevirtual

Get the capabilities of the tensor.

Returns
A set of capabilities that the tensor supports.
See also
TensorCapability, TensorCapabilitySet

◆ GetDimensionCount()

uint IOLink.TensorView.GetDimensionCount ( )
inline

Shortcut to get the number of dimensions of the tensor.

Returns
The number of dimensions of the tensor, which is equal to the size of the shape vector.

◆ GetDtype()

virtual DataType IOLink.TensorView.GetDtype ( )
inlinevirtual

Get the data type of the tensor.

Returns
The data type of the tensor, which describes the type of elements stored in the tensor.

◆ GetShape()

virtual VectorXu64 IOLink.TensorView.GetShape ( )
inlinevirtual

Get the shape of the tensor.

Returns
A vector representing the shape of the tensor, where each element corresponds to the size of the tensor along that dimension.

◆ Read()

unsafe void IOLink.TensorView.Read ( RegionXu64  region,
byte[]  dst 
)
inline

Read data from a given region into a destination buffer.

Parameters
regionThe region of the tensor to read from.
dstThe destination buffer where the read data will be copied.
Exceptions
NotImplementedIf the implementation does not support reading.
InvalidArgumentIf the region is not compatible with the tensor's shape.

◆ Support()

bool IOLink.TensorView.Support ( TensorCapabilitySet  capabilities)
inline

Shortcut to check if capabilities are supported by the tensor.

Parameters
capabilitiesThe set of capabilities to check.
Returns
true if the tensor supports the given capabilities, false otherwise.

◆ Write()

unsafe void IOLink.TensorView.Write ( RegionXu64  region,
byte[]  src 
)
inline

Write data from a source buffer into a given region of the tensor.

Parameters
regionThe region of the tensor to write to.
srcThe source buffer containing the data that will be written.
Exceptions
NotImplementedIf the implementation does not support writing.
InvalidArgumentIf the region is not compatible with the tensor's shape.

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