Package 

Class Tensor


  • 
    public abstract class Tensor
    
                        

    Representation of an ExecuTorch Tensor. Behavior is similar to PyTorch's tensor objects.

    Most tensors will be constructed as Tensor.fromBlob(data, shape), where data can be an array or a direct Buffer (of the proper subclass). Helper methods are provided to allocate buffers properly.

    To access Tensor data, see dtype, shape, and various dataAs* properties.

    When constructing Tensor objects with data as an array, it is not specified whether this data is copied or retained as a reference so it is recommended not to modify it after constructing. data passed as a Buffer is not copied, so it can be modified between Module calls to avoid reallocation. Data retrieved from Tensor objects may be copied or may be a reference to the Tensor's internal data buffer. shape is always copied.

    Warning: These APIs are experimental and subject to change without notice