openvino.runtime.opset1.topk#

openvino.runtime.opset1.topk(data: Node | int | float | ndarray, k: Node | int | float | ndarray, axis: int, mode: str, sort: str, name: str | None = None) Node#

Return a node which performs TopK.

Parameters:
  • data – Input data.

  • k

  • axis – TopK Axis.

  • mode – Compute TopK largest (‘max’) or smallest (‘min’)

  • sort – Order of output elements (sort by: ‘none’, ‘index’ or ‘value’)

Returns:

The new node which performs TopK (both indices and values)