docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Tensor

    Represents data in a multidimensional array-like structure.

    Inheritance
    object
    Tensor
    TensorFloat
    TensorInt
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.Sentis
    Assembly: solution.dll
    Syntax
    public abstract class Tensor : IDisposable

    Constructors

    Name Description
    Tensor(TensorShape, ITensorData, ITensorAllocator)

    Instantiates and returns a Tensor with the specified shape, an ITensorData data and an ITensorAllocator allocator.

    Properties

    Name Description
    allocator

    The allocator for the tensor. Refer to ITensorAllocator.

    dataType

    The data type of the elements of the tensor.

    shape

    The shape of the tensor, as a TensorShape.

    tensorOnDevice

    The device-specific internal representation of the tensor data.

    Methods

    Name Description
    AttachToDevice(ITensorData)

    Associates a tensor with the block of data on a device. Sentis downloads from source on first access.

    Make sure source contains initialized and valid data that represents tensor values.

    CompleteAllPendingOperations()

    Completes all scheduled tensor operations on device.

    DeepCopy()

    Returns a deep copy of the current Tensor.

    DetachFromDevice(bool)

    Synchronizes the tensor data with the data on the device, then remove the tensor from the device.

    Dispose()

    Disposes of the tensor and any associated memory.

    ~Tensor()

    Dispose of the tensor and any associated memory.

    IsReadbackRequestDone()

    Checks if asynchronous readback request it done.

    Returns true if async readback is successful.

    MakeReadable()

    Blocking call to make tensor data read/write.

    Issues a blocking download of the internal data. And converts tensorData to ArrayTensorData

    MakeReadableAsync()

    Non blocking call to make tensor data read/write.

    Issues a non blocking download of the internal data. And converts tensorData to ArrayTensorData

    ReadbackRequest(Action<bool>)

    Schedules asynchronous download of the internal data.

    ReadbackRequestAsync()

    Schedules asynchronous download task of the internal data.

    Boolean indicates if async readback is successful.

    ShallowCopy()

    Returns a shallow copy of the current Tensor. The copy shares data storage with original tensor.

    ShallowReshape(TensorShape)

    Returns a shallow copy of the Tensor with a new shape. The copy shares data storage with the original tensor.

    newShape.length must be equal to this.shape.length.

    TakeOwnership()

    Removes system references to the tensor. The caller assumes ownership.

    ToString()

    Returns a string that represents the Tensor.

    UploadToDevice(ITensorData)

    Uploads the tensor data to the destination data location on device.

    Extension Methods

    TensorExtensions.PrintDataPart(Tensor, int, string)
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)