Class TopK
Represents a TopK
layer. This calculates the top-K largest or smallest elements of an input tensor along a given axis.
This layer calculates both the values tensor of the top-K elements and the indices tensor of the top-K elements as outputs.
Inherited Members
Namespace: Unity.Sentis.Layers
Assembly: solution.dll
Syntax
[Serializable]
public class TopK : Layer
Constructors
Name | Description |
---|---|
TopK(string, string, string, int, bool, bool, string[]) | Initializes and returns an instance of |
Fields
Name | Description |
---|---|
axis | The axis along which to perform the top-K operation. |
largest | Whether to calculate the top-K largest elements. If this is |
sorted | Whether to return the elements in sorted order in the output tensor. |
Methods
Name | Description |
---|---|
Execute(Tensor[], ExecutionContext) | Executes the layer using the operations and variables from the If the layer has more than one output, output tensors are saved to variables. |