Struct TensorShape
Represents the shape of a tensor.
Inherited Members
Namespace: Unity.Sentis
Assembly: solution.dll
Syntax
[Serializable]
public struct TensorShape
Constructors
| Name | Description |
|---|---|
| TensorShape(ReadOnlySpan<int>) | Initializes and returns an instance of |
| TensorShape(int) | Initializes and returns an instance of For example (9). |
| TensorShape(int, int) | Initializes and returns an instance of For example (8, 9). |
| TensorShape(int, int, int) | Initializes and returns an instance of For example (7, 8, 9). |
| TensorShape(int, int, int, int) | Initializes and returns an instance of For example (6, 7, 8, 9). |
| TensorShape(int, int, int, int, int) | Initializes and returns an instance of For example (5, 6, 7, 8, 9). |
| TensorShape(int, int, int, int, int, int) | Initializes and returns an instance of For example (4, 5, 6, 7, 8, 9). |
| TensorShape(int, int, int, int, int, int, int) | Initializes and returns an instance of For example (3, 4, 5, 6, 7, 8, 9). |
| TensorShape(int, int, int, int, int, int, int, int) | Initializes and returns an instance of For example (2, 3, 4, 5, 6, 7, 8, 9). |
| TensorShape(TensorShape) | Returns a copy of another |
Fields
| Name | Description |
|---|---|
| maxRank | The maximum rank a |
Properties
| Name | Description |
|---|---|
| this[int] | Gets or sets the tensor shape at a given axis. A negative axis counts backwards from the inner dimension. |
| length | The number of elements represented by the |
| rank | The rank of a |
Methods
| Name | Description |
|---|---|
| Axis(int) | Returns the positive axis corresponding to a given axis. Negative axes counts backwards from the inner dimension. |
| Broadcast(TensorShape) | Creates a Sentis broadcasts shapes from innermost to outermost dimensions. Two dimensions are compatible when they're equal, or one of the dimensions is 1. |
| BroadcastToRank(int) | Creates a For example, if the |
| Concat(TensorShape, int) | Creates a For example if |
| Equals(object) | Determines whether the specified object is equal to the current |
| Flatten(int) | Creates a For example, if |
| GetHashCode() | Serves as the default hash function. |
| HasZeroDims() | Calculates whether any axes are length 0. In this case the length is also 0. |
| Length(int) | Returns the number of elements represented by the |
| Length(int, int) | Returns the number of elements represented by the |
| MatMul(TensorShape) | Creates a |
| Ones(int) | Creates a |
| Pad(ReadOnlySpan<int>) | Creates a |
| RavelIndex(int, int) | Converts the indexes of the shape: (6,7) => 1 * (7) + 5 = 12 index: (1,5) |
| RavelIndex(int, int, int) | Converts the indexes of the shape: (5,6,7) => 2 * (6*7) + 1 * (7) + 5 = 96 index: (2,1,5) |
| RavelIndex(int, int, int, int) | Converts the indexes of the shape: (4,5,6,7) => 3 * (567) + 2 * (6*7) + 1 * (7) + 5 = 726 index: (3,2,1,5) |
| RavelIndex(int, int, int, int, int) | Converts the indexes of the shape: (3,4,5,6,7) => 0 * (4567) + 3 * (567) + 2 * (67) + 1 * (7) + 5 = 726 index: (0,3,2,1,5) |
| RavelIndex(int, int, int, int, int, int) | Converts the indexes of the shape: (2,3,4,5,6,7) => 1 * (34567) + 0 * (4567) + 3 * (567) + 2 * (67) + 1 * (7) + 5 = 3246 index: (1,0,3,2,1,5) |
| RavelIndex(int, int, int, int, int, int, int) | Converts the indexes of the shape: (1,2,3,4,5,6,7) => 0 * (234567) + 1 * (34567) + 0 * (4567) + 3 * (567) + 2 * (6*7) + 1 * (7) + 5 = 3246 index: (0,1,0,3,2,1,5) |
| RavelIndex(int, int, int, int, int, int, int, int) | Converts the indexes of the shape: (5,1,2,3,4,5,6,7) => 2 * (1234567) + 0 * (234567) + 1 * (34567) + 0 * (4567) + 3 * (567) + 2 * (6*7) + 1 * (7) + 5 = 13326 index: (2,0,1,0,3,2,1,5) |
| Reduce(ReadOnlySpan<int>, bool) | Creates a |
| Reduce(int, bool) | Removes a dimension at |
| Reshape(ReadOnlySpan<int>, bool) | Creates a If a dimension in the shape array is -1, Sentis infers the value from the size of the |
| Slice(ReadOnlySpan<int>, ReadOnlySpan<int>, ReadOnlySpan<int>, ReadOnlySpan<int>) | Creates a |
| Squeeze() | Creates a |
| Squeeze(ReadOnlySpan<int>) | Creates a |
| Squeeze(int) | Creates a |
| Strides(int) | Returns the product of the dimensions of the tensor shape after a given axis. Negative axes counts backwards from the inner dimension. The strides of a tensor tell us how many elements we have to skip in flattened memory to move to the next position along a given index. |
| Tile(ReadOnlySpan<int>) | Creates a |
| ToArray() | Returns the |
| ToString() | Returns a string that represents the |
| Transpose() | Creates a |
| Transpose(int[]) | Creates a |
| Unsqueeze(ReadOnlySpan<int>) | Creates a |
| Unsqueeze(int) | Creates a |
Operators
| Name | Description |
|---|---|
| operator ==(TensorShape, TensorShape) | Compares two |
| operator !=(TensorShape, TensorShape) | Compares two |