docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct SymbolicTensorShape

    Represents the shape of an input tensor, or the predicted shape of a tensor before Sentis executes.

    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Sentis
    Assembly: Unity.Sentis.dll
    Syntax
    [Serializable]
    public struct SymbolicTensorShape

    Constructors

    SymbolicTensorShape(int)

    Initializes and returns an instance of SymbolicTensorShape with a rank of 1: (d0).

    For example (9).

    Declaration
    public SymbolicTensorShape(int d0)
    Parameters
    Type Name Description
    int d0

    The SymbolicTensorDim of axis 0.

    SymbolicTensorShape(int, int)

    Initializes and returns an instance of SymbolicTensorShape with a rank of 2: (d1, d0).

    For example (8, 9).

    Declaration
    public SymbolicTensorShape(int d1, int d0)
    Parameters
    Type Name Description
    int d1

    The SymbolicTensorDim of axis 1.

    int d0

    The SymbolicTensorDim of axis 0.

    SymbolicTensorShape(int, int, int)

    Initializes and returns an instance of SymbolicTensorShape with a rank of 3: (d2, d1, d0).

    For example (7, 8, 9).

    Declaration
    public SymbolicTensorShape(int d2, int d1, int d0)
    Parameters
    Type Name Description
    int d2

    The SymbolicTensorDim of axis 2.

    int d1

    The SymbolicTensorDim of axis 1.

    int d0

    The SymbolicTensorDim of axis 0.

    SymbolicTensorShape(int, int, int, int)

    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(int d3, int d2, int d1, int d0)
    Parameters
    Type Name Description
    int d3

    The SymbolicTensorDim of axis 3.

    int d2

    The SymbolicTensorDim of axis 2.

    int d1

    The SymbolicTensorDim of axis 1.

    int d0

    The SymbolicTensorDim of axis 0.

    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

    The SymbolicTensorDim of axis 0.

    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

    The SymbolicTensorDim of axis 1.

    SymbolicTensorDim d0

    The SymbolicTensorDim of axis 0.

    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

    The SymbolicTensorDim of axis 2.

    SymbolicTensorDim d1

    The SymbolicTensorDim of axis 1.

    SymbolicTensorDim d0

    The SymbolicTensorDim of axis 0.

    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

    The SymbolicTensorDim of axis 3.

    SymbolicTensorDim d2

    The SymbolicTensorDim of axis 2.

    SymbolicTensorDim d1

    The SymbolicTensorDim of axis 1.

    SymbolicTensorDim d0

    The SymbolicTensorDim of axis 0.

    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

    The SymbolicTensorDim of axis 4.

    SymbolicTensorDim d3

    The SymbolicTensorDim of axis 3.

    SymbolicTensorDim d2

    The SymbolicTensorDim of axis 2.

    SymbolicTensorDim d1

    The SymbolicTensorDim of axis 1.

    SymbolicTensorDim d0

    The SymbolicTensorDim of axis 0.

    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

    The SymbolicTensorDim of axis 5.

    SymbolicTensorDim d4

    The SymbolicTensorDim of axis 4.

    SymbolicTensorDim d3

    The SymbolicTensorDim of axis 3.

    SymbolicTensorDim d2

    The SymbolicTensorDim of axis 2.

    SymbolicTensorDim d1

    The SymbolicTensorDim of axis 1.

    SymbolicTensorDim d0

    The SymbolicTensorDim of axis 0.

    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

    The SymbolicTensorDim of axis 6.

    SymbolicTensorDim d5

    The SymbolicTensorDim of axis 5.

    SymbolicTensorDim d4

    The SymbolicTensorDim of axis 4.

    SymbolicTensorDim d3

    The SymbolicTensorDim of axis 3.

    SymbolicTensorDim d2

    The SymbolicTensorDim of axis 2.

    SymbolicTensorDim d1

    The SymbolicTensorDim of axis 1.

    SymbolicTensorDim d0

    The SymbolicTensorDim of axis 0.

    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

    The SymbolicTensorDim of axis 7.

    SymbolicTensorDim d6

    The SymbolicTensorDim of axis 6.

    SymbolicTensorDim d5

    The SymbolicTensorDim of axis 5.

    SymbolicTensorDim d4

    The SymbolicTensorDim of axis 4.

    SymbolicTensorDim d3

    The SymbolicTensorDim of axis 3.

    SymbolicTensorDim d2

    The SymbolicTensorDim of axis 2.

    SymbolicTensorDim d1

    The SymbolicTensorDim of axis 1.

    SymbolicTensorDim d0

    The SymbolicTensorDim of axis 0.

    SymbolicTensorShape(SymbolicTensorShape)

    Returns a copy of another SymbolicTensorShape.

    Declaration
    public SymbolicTensorShape(SymbolicTensorShape other)
    Parameters
    Type Name Description
    SymbolicTensorShape other

    The SymbolicTensorShape to copy.

    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

    The TensorShape to copy.

    Properties

    this[int]

    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
    int 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 int rank { get; }
    Property Value
    Type Description
    int

    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

    The object to compare.

    Returns
    Type Description
    bool

    Whether the object is equal to the current SymbolicTensorShape.

    Overrides
    ValueType.Equals(object)

    GetHashCode()

    Serves as the default hash function.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    The calculated hash code.

    Overrides
    ValueType.GetHashCode()

    IsFullyKnown()

    Checks if the SymbolicTensorShape is fully defined and can be converted to a TensorShape.

    Declaration
    public bool IsFullyKnown()
    Returns
    Type Description
    bool

    Whether the SymbolicTensorShape has fixed rank all fixed dimensions.

    ToString()

    Returns a string that represents the SymbolicTensorShape.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    The string representation of the SymbolicTensorShape.

    Overrides
    ValueType.ToString()

    ToTensorShape()

    Converts the SymbolicTensorShape to a TensorShape. You should call IsFullyKnown before you call this method.

    Declaration
    public TensorShape ToTensorShape()
    Returns
    Type Description
    TensorShape

    The converted TensorShape.

    UnknownOfRank(int)

    Creates and returns a SymbolicTensorShape with given rank and all dimensions unknown.

    Declaration
    public static SymbolicTensorShape UnknownOfRank(int rank)
    Parameters
    Type Name Description
    int rank

    The rank of the SymbolicTensorShape.

    Returns
    Type Description
    SymbolicTensorShape

    The created SymbolicTensorShape.

    Operators

    operator ==(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

    The first SymbolicTensorShape to compare.

    SymbolicTensorShape b

    The second SymbolicTensorShape to compare.

    Returns
    Type Description
    bool

    Whether the two SymbolicTensorShape objects are equal.

    operator !=(SymbolicTensorShape, SymbolicTensorShape)

    Compares two SymbolicTensorShape objects. Returns true if the two shapes have a different or unknown rank, or at least one of their dimensions are not equal.

    Declaration
    public static bool operator !=(SymbolicTensorShape a, SymbolicTensorShape b)
    Parameters
    Type Name Description
    SymbolicTensorShape a

    The first SymbolicTensorShape to compare.

    SymbolicTensorShape b

    The second SymbolicTensorShape to compare.

    Returns
    Type Description
    bool

    Whether the two SymbolicTensorShape objects are not equal.

    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)