Struct TensorIndex
Represents a set of indices corresponding to each axis of a tensor
Inherited Members
Namespace: Unity.Sentis
Assembly: solution.dll
Syntax
[Serializable]
public struct TensorIndex
Constructors
Name | Description |
---|---|
TensorIndex(int) | Creates a rank-1 tensor index (d0) Ex: (9) |
TensorIndex(int, int) | Creates a rank-2 tensor index (d1, d0) Ex: (8,9) |
TensorIndex(int, int, int) | Creates a rank-3 tensor index (d2, d1, d0) Ex: (7,8,9) |
TensorIndex(int, int, int, int) | Creates a rank-4 tensor index (d3, d2, d1, d0) Ex: (6,7,8,9) |
TensorIndex(int, int, int, int, int) | Creates a rank-5 tensor index (d4, d3, d2, d1, d0) Ex: (5,6,7,8,9) |
TensorIndex(int, int, int, int, int, int) | Creates a rank-6 tensor index (d5, d4, d3, d2, d1, d0) Ex: (4,5,6,7,8,9) |
TensorIndex(int, int, int, int, int, int, int) | Creates a rank-7 tensor index (d6, d5, d4, d3, d2, d1, d0) Ex: (3,4,5,6,7,8,9) |
TensorIndex(int, int, int, int, int, int, int, int) | Creates a rank-8 tensor index (d7, d6, d5, d4, d3, d2, d1, d0) Ex: (2,3,4,5,6,7,8,9) |
TensorIndex(int[]) | Creates a tensor index given an input int[] representing the index Ex: TensorIndex(new [] {3,4,5,6}) = (3,4,5,6) |
TensorIndex(TensorIndex) | Instantiates and returns a copy of another |
Fields
Name | Description |
---|---|
maxRank | TensorIndex cannot have a bigger rank than maxRank |
Properties
Name | Description |
---|---|
this[int] | Gets/Sets tensor index at a given axis Ex: index (3, 4, 5, 6) index 0, 1, 2, 3 -4,-3,-2,-1 index (7, 3, 2) index 0, 1, 2 -3,-2,-1 |
rank | Rank of a TensorIndex: Ex: (5) -> rank:1 (3,5) -> rank:2 (7,3,5) -> rank:3 (6,7,3,5) -> rank:4 |
Methods
Name | Description |
---|---|
Axis(int) | Wraps axis to positive index between 0,rank (5,2,3,4) axis = -1 => axis_out = 3 axis = 1 => axis_out = 1 |
Equals(object) | Determines whether the specified object is equal to the current |
GetHashCode() | Serves as the default hash function. |
ToString() | Returns a string that represents the |
Zeros(int) | Creates index with zeros 0 of specified rank Ex: EmptyOfRank(rank: 3) => (0, 0, 0) |
Operators
Name | Description |
---|---|
operator ==(TensorIndex, TensorIndex) | Compares two |
operator !=(TensorIndex, TensorIndex) | Compares two |