docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct TensorIndex

    Represents a set of indices corresponding to each axis of a tensor

    Inherited Members
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    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 TensorIndex.

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

    GetHashCode()

    Serves as the default hash function.

    ToString()

    Returns a string that represents the TensorIndex.

    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 TensorIndex objects Two TensorIndices are equal if they have the same rank and all their dimensions are equal

    operator !=(TensorIndex, TensorIndex)

    Compares two TensorIndex objects

    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)