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.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.Sentis
    Assembly: solution.dll
    Syntax
    [Serializable]
    public struct SymbolicTensorShape

    Constructors

    Name Description
    SymbolicTensorShape(int)

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

    For example (9).

    SymbolicTensorShape(int, int)

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

    For example (8, 9).

    SymbolicTensorShape(int, int, int)

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

    For example (7, 8, 9).

    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).

    SymbolicTensorShape(SymbolicTensorDim)

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

    For example (9).

    SymbolicTensorShape(SymbolicTensorDim, SymbolicTensorDim)

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

    For example (8, 9).

    SymbolicTensorShape(SymbolicTensorDim, SymbolicTensorDim, SymbolicTensorDim)

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

    For example (7, 8, 9).

    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).

    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).

    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).

    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).

    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).

    SymbolicTensorShape(SymbolicTensorShape)

    Returns a copy of another SymbolicTensorShape.

    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).

    Properties

    Name Description
    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

    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.

    Methods

    Name Description
    Equals(object)

    Determines whether the specified object is equal to the current SymbolicTensorShape.

    GetHashCode()

    Serves as the default hash function.

    IsFullyKnown()

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

    ToString()

    Returns a string that represents the SymbolicTensorShape.

    ToTensorShape()

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

    UnknownOfRank(int)

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

    Operators

    Name Description
    operator ==(SymbolicTensorShape, SymbolicTensorShape)

    Compares two SymbolicTensorShape objects. Returns true if the two objects have the same rank, and all their dimensions 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.

    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)