Struct SymbolicTensorShape
Represents the shape of an input tensor, or the predicted shape of a tensor before Sentis executes.
Inherited Members
Namespace: Unity.Sentis
Syntax
[Serializable]
public struct SymbolicTensorShape
Constructors
SymbolicTensorShape(Int32[])
Initializes and returns an instance of SymbolicTensorShape
with a given shape, and no unknown or dynamic dimensions. For example: SymbolicTensorShape(new [] {3, 4, 5, 6})
returns a symbolic tensor shape of (3, 4, 5, 6).
Declaration
public SymbolicTensorShape(int[] shape)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | shape |
SymbolicTensorShape(SymbolicTensorDim)
Initializes and returns an instance of SymbolicTensorShape
with a rank of 1: (d0).
For example (9).
Declaration
public SymbolicTensorShape(SymbolicTensorDim d0)
Parameters
Type | Name | Description |
---|---|---|
SymbolicTensorDim | d0 |
SymbolicTensorShape(SymbolicTensorDim, SymbolicTensorDim)
Initializes and returns an instance of SymbolicTensorShape
with a rank of 2: (d1, d0).
For example (8, 9).
Declaration
public SymbolicTensorShape(SymbolicTensorDim d1, SymbolicTensorDim d0)
Parameters
Type | Name | Description |
---|---|---|
SymbolicTensorDim | d1 | |
SymbolicTensorDim | d0 |
SymbolicTensorShape(SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim)
Initializes and returns an instance of SymbolicTensorShape
with a rank of 3: (d2, d1, d0).
For example (7, 8, 9).
Declaration
public SymbolicTensorShape(SymbolicTensorDim d2, SymbolicTensorDim d1, SymbolicTensorDim d0)
Parameters
Type | Name | Description |
---|---|---|
SymbolicTensorDim | d2 | |
SymbolicTensorDim | d1 | |
SymbolicTensorDim | d0 |
SymbolicTensorShape(SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim)
Initializes and returns an instance of SymbolicTensorShape
with a rank of 4: (d3, d2, d1, d0).
For example (6, 7, 8, 9).
Declaration
public SymbolicTensorShape(SymbolicTensorDim d3, SymbolicTensorDim d2, SymbolicTensorDim d1, SymbolicTensorDim d0)
Parameters
Type | Name | Description |
---|---|---|
SymbolicTensorDim | d3 | |
SymbolicTensorDim | d2 | |
SymbolicTensorDim | d1 | |
SymbolicTensorDim | d0 |
SymbolicTensorShape(SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim)
Initializes and returns an instance of SymbolicTensorShape
with a rank of 5: (d4, d3, d2, d1, d0).
For example (5, 6, 7, 8, 9).
Declaration
public SymbolicTensorShape(SymbolicTensorDim d4, SymbolicTensorDim d3, SymbolicTensorDim d2, SymbolicTensorDim d1, SymbolicTensorDim d0)
Parameters
Type | Name | Description |
---|---|---|
SymbolicTensorDim | d4 | |
SymbolicTensorDim | d3 | |
SymbolicTensorDim | d2 | |
SymbolicTensorDim | d1 | |
SymbolicTensorDim | d0 |
SymbolicTensorShape(SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim)
Initializes and returns an instance of SymbolicTensorShape
with a rank of 6: (d5, d4, d3, d2, d1, d0).
For example (4, 5, 6, 7, 8, 9).
Declaration
public SymbolicTensorShape(SymbolicTensorDim d5, SymbolicTensorDim d4, SymbolicTensorDim d3, SymbolicTensorDim d2, SymbolicTensorDim d1, SymbolicTensorDim d0)
Parameters
Type | Name | Description |
---|---|---|
SymbolicTensorDim | d5 | |
SymbolicTensorDim | d4 | |
SymbolicTensorDim | d3 | |
SymbolicTensorDim | d2 | |
SymbolicTensorDim | d1 | |
SymbolicTensorDim | d0 |
SymbolicTensorShape(SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim)
Initializes and returns an instance of SymbolicTensorShape
with a rank of 7: (d6, d5, d4, d3, d2, d1, d0).
For example (3, 4, 5, 6, 7, 8, 9).
Declaration
public SymbolicTensorShape(SymbolicTensorDim d6, SymbolicTensorDim d5, SymbolicTensorDim d4, SymbolicTensorDim d3, SymbolicTensorDim d2, SymbolicTensorDim d1, SymbolicTensorDim d0)
Parameters
Type | Name | Description |
---|---|---|
SymbolicTensorDim | d6 | |
SymbolicTensorDim | d5 | |
SymbolicTensorDim | d4 | |
SymbolicTensorDim | d3 | |
SymbolicTensorDim | d2 | |
SymbolicTensorDim | d1 | |
SymbolicTensorDim | d0 |
SymbolicTensorShape(SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim)
Initializes and returns an instance of SymbolicTensorShape
with a rank of 8: (d7, d6, d5, d4, d3, d2, d1, d0).
For example (2, 3, 4, 5, 6, 7, 8, 9).
Declaration
public SymbolicTensorShape(SymbolicTensorDim d7, SymbolicTensorDim d6, SymbolicTensorDim d5, SymbolicTensorDim d4, SymbolicTensorDim d3, SymbolicTensorDim d2, SymbolicTensorDim d1, SymbolicTensorDim d0)
Parameters
Type | Name | Description |
---|---|---|
SymbolicTensorDim | d7 | |
SymbolicTensorDim | d6 | |
SymbolicTensorDim | d5 | |
SymbolicTensorDim | d4 | |
SymbolicTensorDim | d3 | |
SymbolicTensorDim | d2 | |
SymbolicTensorDim | d1 | |
SymbolicTensorDim | d0 |
SymbolicTensorShape(SymbolicTensorDim[])
Initializes and returns an instance of SymbolicTensorShape
with a given shape, including unknown or dynamic dimensions. For example: SymbolicTensorShape(new [] { new SymbolicTensorDim(3), new SymbolicTensorDim('A'), SymbolicTensorDim.Unknown } )
returns a symbolic tensor shape of (3, 'A', ?).
Declaration
public SymbolicTensorShape(SymbolicTensorDim[] shape)
Parameters
Type | Name | Description |
---|---|---|
SymbolicTensorDim[] | shape |
SymbolicTensorShape(SymbolicTensorShape)
Returns a copy of another SymbolicTensorShape
.
Declaration
public SymbolicTensorShape(SymbolicTensorShape other)
Parameters
Type | Name | Description |
---|---|---|
SymbolicTensorShape | other |
SymbolicTensorShape(TensorShape)
Initializes and returns an instance of SymbolicTensorShape
with a given TensorShape
, and no unknown or dynamic dimensions. For example: SymbolicTensorShape(new TensorShape(3, 4, 5, 6))
returns a symbolic tensor shape of (3, 4, 5, 6).
Declaration
public SymbolicTensorShape(TensorShape other)
Parameters
Type | Name | Description |
---|---|---|
TensorShape | other |
Properties
Item[Int32]
Gets or sets the tensor shape at a given axis. Ex: shape (3, 4, 5, 6) index 0, 1, 2, 3 -4,-3,-2,-1 shape (7, 3, 2) index 0, 1, 2 -3,-2,-1
Declaration
public SymbolicTensorDim this[int axis] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | axis |
Property Value
Type | Description |
---|---|
SymbolicTensorDim |
rank
The rank of a SymbolicTensorShape
, For example, a tensor of shape (5) has a rank of 1. A tensor of shape (7, 3, 5) has a rank of 3.
Declaration
public readonly int rank { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
Equals(Object)
Determines whether the specified object is equal to the current SymbolicTensorShape
.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
IsFullyKnown()
Checks if the SymbolicTensorShape
is fully defined and converted to a TensorShape
.
Declaration
public bool IsFullyKnown()
Returns
Type | Description |
---|---|
Boolean |
ToString()
Returns a string that represents the SymbolicTensorShape
.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
ToTensorShape()
Converts the SymbolicTensorShape
to a TensorShape
. You should call IsFullyKnown
before you call this method.
Declaration
public TensorShape ToTensorShape()
Returns
Type | Description |
---|---|
TensorShape |
Operators
Equality(SymbolicTensorShape, SymbolicTensorShape)
Compares two SymbolicTensorShape
objects. Returns true
if the two objects have the same rank, and all their dimensions are equal.
Declaration
public static bool operator ==(SymbolicTensorShape a, SymbolicTensorShape b)
Parameters
Type | Name | Description |
---|---|---|
SymbolicTensorShape | a | |
SymbolicTensorShape | b |
Returns
Type | Description |
---|---|
Boolean |
Inequality(SymbolicTensorShape, SymbolicTensorShape)
Declaration
public static bool operator !=(SymbolicTensorShape a, SymbolicTensorShape b)
Parameters
Type | Name | Description |
---|---|---|
SymbolicTensorShape | a | |
SymbolicTensorShape | b |
Returns
Type | Description |
---|---|
Boolean |