Class TopK

Inheritance Relationships

Base Type

  • public mindspore::ops::BaseOperator

Derived Type

Class Documentation

class TopK : public mindspore::ops::BaseOperator

Finds values and indices of the k largest entries along the last dimension. Refer to Python API mindspore.ops.TopK for more details.

Subclassed by mindspore::ops::TopKFusion

Public Functions

inline explicit TopK(const std::string &k_name = kNameTopK)

Constructor.

void Init(const bool sorted = false)

Init. Refer to the parameters of Python API mindspore.ops.TopK for the inputs.

void set_sorted(const bool sorted)

Set sorted.

bool get_sorted() const

Get sorted.

Returns

sorted.