Namespace Unity.Sentis
Classes
CPUTensorData
Represents Burst-specific internal data storage for a Tensor
.
CommandBufferWorkerExtensions
Provides extension methods for scheduling the worker from a CommandBuffer.
ComputeTensorData
Represents data storage for a Tensor
as a compute buffer, for GPUCompute backend.
Constant
Represents a constant in a model.
Functional
Represents the static functional methods for model building and compilation.
FunctionalExtensions
Represents extension functions for the Sentis functional API.
FunctionalGraph
Represents a model graph using the functional API.
Input functional tensors can be added to the graph, then manipulated using the functional API methods.
The functional graph can be compiled to return an optimized Sentis runtime model.
FunctionalTensor
Represents a tensor that is a result of tensor operations.
Layer
Represents the base class for all model layers.
Model
Represents a Sentis neural network.
ModelAsset
Represents a Sentis model asset.
ModelLoader
Provides methods for loading models.
ModelQuantizer
Provides methods for quantizing models.
ModelWriter
Provides methods for saving models.
NativeTensorArray
Represents an area of native memory that's exposed to managed code.
NativeTensorArrayFromManagedArray
Represents an area of managed memory that's exposed as if it's native memory.
Random
Represents a pseudo-random number generator used by Sentis.
Tensor
Represents data in a multidimensional array-like structure.
Ownership and lifetime:
- Disposed needs to be called on the main thread.
- Ownership is always to the owner of the object.
Data Representation:
- TensorShape represents the data layout of the tensor
- Data is held by a tensorData (ITensorData) which can be on a given backend
- Data is stored in a flattened row major format
- Data can be pending (ie computation is being done in parallel)
- call CompleteAllPendingOperations for a blocking call to finish computing the tensor's data Data can be in a non readable type (GPU/NPU)
- Call CompleteAllPendingOperations to finish computing the tensor's data
- Call ReadbackAndClone or ReadBackAndCloneAsync to allow reading the tensor's data
Data manipulation
- ToReadOnlyArray returns a copy of the tensor's data
- dataOnBackend can be manipulated directly to avoid a unnecessary copy see ComputeTensorData/CPUTensorData for info
Tensor<T>
Represents data in a multidimensional array-like structure.
Ownership and lifetime:
- Disposed needs to be called on the main thread.
- Ownership is always to the owner of the object.
Data Representation:
- TensorShape represents the data layout of the tensor
- Data is held by a tensorData (ITensorData) which can be on a given backend
- Data is stored in a flattened row major format
- Data can be pending (ie computation is being done in parallel)
- call CompleteAllPendingOperations for a blocking call to finish computing the tensor's data Data can be in a non readable type (GPU/NPU)
- Call CompleteAllPendingOperations to finish computing the tensor's data
- Call ReadbackAndClone or ReadBackAndCloneAsync to allow reading the tensor's data
Data manipulation
- ToReadOnlyArray returns a copy of the tensor's data
- dataOnBackend can be manipulated directly to avoid a unnecessary copy see ComputeTensorData/CPUTensorData for info
TextureConverter
Provides methods for converting between textures and tensors.
TextureTensorData
Represents the data storage for a 'Tensor' as a render texture, for backends that use GPU pixel shaders.
Sentis packs the tensor data into the pixels of an RGBA float4 texture.
Sentis chooses a single tensor dimension as the blocked axis, across which data is chunked in float4 blocks.
Tensor dimensions don't map directly to texture dimensions. Sentis creates the texture with dimensions large enough to fit all the data and pixel shaders index the data based on both the tensor and texture dimensions (see example below).
Worker
Represents a worker that allows you to execute neural networks (models).
Worker
abstracts implementation details on different hardware devices such as the CPU and the GPU. Worker
lets you do the following:
- Specify inputs.
- Schedule the work.
- Get outputs.
Internally, Worker
translates the neural network from a Model into a set of operations, then sends the operations to the hardware device for asynchronous execution.
Structs
DynamicTensorShape
Represents the shape of an input tensor, or the predicted shape of a tensor before Sentis executes.
Model.Input
Represents an input to a model.
Model.Output
Represents an output to a model.
ONNXModelMetadata
Contains additional metadata about the ONNX model, stored in the ONNX file.
TensorShape
Represents the shape of a tensor.
TextureTransform
Represents settings for converting between textures and tensors.
Create an instance of TextureTransform
using the constructor, then use the TextureTransform
object as a parameter in TextureConverter
methods.
For example: TextureTransform settings = new TextureTransform().SetDimensions(256, 256, 4).SetTensorLayout(TensorLayout.NHWC);
Interfaces
IONNXMetadataImportCallbackReceiver
Implement this interface to receive model metadata during ONNX import.
ITensorData
An interface that represents a device-dependent representation of the data in a tensor.
Enums
BackendType
Types of backend that Sentis uses to execute a neural network.
Channel
Set the position of each color channel in a texture tensor.
ChannelSwizzle
Options for the order of the color channels in a texture tensor.
CoordOrigin
Options for the position of the origin (0, 0) in the x and y dimensions of a texture tensor.
DataType
Options for the data type of a Tensor
.
DeviceType
Types of devices that Sentis uses to execute a neural network.
QuantizationType
Type of quantization for float weights.
TensorLayout
Options for the dimension layout in a texture tensor.