17#include "../KernelGenerator.h"
18#include "../Validator.h"
25void Validator::visit(
const ir::operation::TopKV2 &) {
_supported =
true; }
27void KernelGenerator::visit(
const ir::operation::TopKV2 &node)
30 const auto outputIndices_index{
36 assert(_ctx.
at(inputData_index).shape().rank() == 1 ||
37 _ctx.
at(inputData_index).shape().rank() == 2);
39 const auto k = node.param().k;
41 auto values_tensor = _tensor_reg->getAclTensor(outputValues_index);
42 auto indices_tensor = _tensor_reg->getAclTensor(outputIndices_index);
43 auto input_tensor = _tensor_reg->getAclTensor(inputData_index);
45 auto fn = acl_common::generateLayer<arm_compute::CLTopKV2>(
46 input_tensor->handle(), k, values_tensor->handle(), indices_tensor->handle());
std::unique_ptr< exec::IFunction > _return_fn
const Object & at(const Index &index) const
Get the object that is associated with the given index.
std::unique_ptr< AclFunction > asAclFunction(std::unique_ptr<::arm_compute::IFunction > &&layer)