docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method Flatten

    Flatten(int)

    Creates a TensorShape by duplicating this and reshaping to a 2D matrix. The dimensions before axis are collapsed into the outer dimension and the remaining axes are collapsed into the inner dimension.

    For example, if this is (2, 3, 4), and the value of axis is 2, the method returns (2 * 3, 4).

    Declaration
    public TensorShape Flatten(int axis = 1)
    Parameters
    Type Name Description
    int axis

    The axis at which to flatten.

    Returns
    Type Description
    TensorShape

    The flattened tensor shape.

    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)