docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Constructor TopK

    TopK(string, string, string, int, bool, bool, string[])

    Initializes and returns an instance of TopK layer.

    Declaration
    public TopK(string name, string input, string k, int axis, bool largest, bool sorted, string[] outputNames)
    Parameters
    Type Name Description
    string name

    The name to use for the values tensor of the layer.

    string input

    The name to use for the input tensor of the layer.

    string k

    The name to use for the single value 1D tensor containing the number of elements to calculate.

    int axis

    The axis along which to perform the top-K operation.

    bool largest

    Whether to calculate the top-K largest elements. If this is false the layer calculates the top-K smallest elements.

    bool sorted

    Whether to return the elements in sorted order in the output tensor.

    string[] outputNames

    A two-element array containing the names to use for the values and indices output tensors of the layer respectively.

    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)