Home
last modified time | relevance | path

Searched refs:top_k (Results 1 – 25 of 55) sorted by relevance

123

/external/tensorflow/tensorflow/lite/kernels/
Dtopk_v2.cc38 const TfLiteTensor* top_k; in ResizeOutput() local
39 TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputTopK, &top_k)); in ResizeOutput()
41 TF_LITE_ENSURE_TYPES_EQ(context, top_k->type, kTfLiteInt32); in ResizeOutput()
43 TF_LITE_ENSURE_EQ(context, NumElements(top_k), 1); in ResizeOutput()
44 const int32 k = *GetTensorData<int32_t>(top_k); in ResizeOutput()
191 const auto& top_k = topc.sorted_result(); in TopK() local
192 std::copy(top_k.begin(), top_k.end(), indexes_row); in TopK()
193 std::transform(top_k.begin(), top_k.end(), output_row, in TopK()
212 const TfLiteTensor* top_k; in Prepare() local
213 TF_LITE_ENSURE_OK(context, GetInputSafe(context, node, kInputTopK, &top_k)); in Prepare()
[all …]
Dtopk_v2_test.cc38 TopKV2OpModel(int top_k, std::initializer_list<int> input_shape, in TopKV2OpModel() argument
45 top_k_ = AddConstInput(TensorType_INT32, {top_k}, {1}); in TopKV2OpModel()
54 PopulateTensor<int32_t>(top_k_, {top_k}); in TopKV2OpModel()
/external/tensorflow/tensorflow/compiler/xla/mlir_hlo/tests/Dialect/chlo/
Dchlo_ops.mlir85 func.func @top_k(%arg0 : tensor<*xf32>) {
87 %0:2 = chlo.top_k(%arg0, k=8) : tensor<*xf32> -> (tensor<8xf32>, tensor<8xi32>)
93 func.func @top_k(%arg0 : tensor<f32>) {
95 %0:2 = chlo.top_k(%arg0, k=8) : tensor<f32> -> (tensor<8xf32>, tensor<8xi32>)
101 func.func @top_k(%arg0 : tensor<?xf32>) {
103 %0:2 = chlo.top_k(%arg0, k=8) : tensor<?xf32> -> (tensor<8xf32>, tensor<8xi32>)
109 func.func @top_k(%arg0 : tensor<4xf32>) {
111 %0:2 = chlo.top_k(%arg0, k=8) : tensor<4xf32> -> (tensor<8xf32>, tensor<8xi32>)
117 func.func @top_k(%arg0 : tensor<16xf32>) {
118 %0:2 = chlo.top_k(%arg0, k=8) : tensor<16xf32> -> (tensor<8xf32>, tensor<8xi32>)
[all …]
/external/tensorflow/tensorflow/compiler/xla/mlir_hlo/stablehlo/tests/
Dops_chlo.mlir85 func.func @top_k(%arg0 : tensor<*xf32>) {
87 %0:2 = chlo.top_k(%arg0, k=8) : tensor<*xf32> -> (tensor<8xf32>, tensor<8xi32>)
93 func.func @top_k(%arg0 : tensor<f32>) {
95 %0:2 = chlo.top_k(%arg0, k=8) : tensor<f32> -> (tensor<8xf32>, tensor<8xi32>)
101 func.func @top_k(%arg0 : tensor<?xf32>) {
103 %0:2 = chlo.top_k(%arg0, k=8) : tensor<?xf32> -> (tensor<8xf32>, tensor<8xi32>)
109 func.func @top_k(%arg0 : tensor<4xf32>) {
111 %0:2 = chlo.top_k(%arg0, k=8) : tensor<4xf32> -> (tensor<8xf32>, tensor<8xi32>)
117 func.func @top_k(%arg0 : tensor<16xf32>) {
118 %0:2 = chlo.top_k(%arg0, k=8) : tensor<16xf32> -> (tensor<8xf32>, tensor<8xi32>)
[all …]
/external/tensorflow/tensorflow/compiler/xla/client/lib/
Dapprox_topk.cc111 absl::Span<const XlaOp> init_values, int64_t top_k, in AggregateToTopKBuilder() argument
118 if (top_k == 1) { in AggregateToTopKBuilder()
145 slice_limit_indices[reduction_dim] = top_k; in AggregateToTopKBuilder()
158 absl::Span<const XlaOp> init_values, int64_t top_k, in ApproxTopK() argument
190 return AggregateToTopKBuilder(builder, operands, init_values, top_k, in ApproxTopK()
197 n, rank, top_k, recall_target, /*aggregate_to_topk=*/false, in ApproxTopK()
209 return AggregateToTopKBuilder(builder, operands, init_values, top_k, in ApproxTopK()
248 top_k, reduction_dim, comparator); in ApproxTopK()
254 absl::Span<const XlaOp> init_values, int64_t top_k, in ApproxTopKFallback() argument
264 n, rank, top_k, recall_target, aggregate_to_topk, in ApproxTopKFallback()
Dapprox_topk_shape.cc39 int64_t input_size, int64_t rank, int64_t top_k, float recall_target, in ApproxTopKReductionOutputSize() argument
42 return std::pair<int64_t, int64_t>(top_k, -1); in ApproxTopKReductionOutputSize()
63 if (top_k == 1) { in ApproxTopKReductionOutputSize()
95 static_cast<uint64_t>((1.0 - top_k) / in ApproxTopKReductionOutputSize()
Dapprox_topk.h54 absl::Span<const XlaOp> init_values, int64_t top_k,
61 absl::Span<const XlaOp> init_values, int64_t top_k,
Dapprox_topk_shape.h43 int64_t input_size, int64_t rank, int64_t top_k, float recall_target,
/external/tensorflow/tensorflow/compiler/tf2xla/kernels/
Dapprox_topk_op.cc99 absl::Span<const xla::XlaOp> init_values, int64_t top_k,
122 absl::Span<const xla::XlaOp> init_values, int64_t top_k, in ApproxTopKFn() argument
126 return xla::ApproxTopK(builder, operands, init_values, top_k, reduction_dim, in ApproxTopKFn()
140 absl::Span<const xla::XlaOp> init_values, int64_t top_k, in ApproxTopKFn() argument
145 builder, operands, init_values, top_k, reduction_dim, comparator, in ApproxTopKFn()
/external/tensorflow/tensorflow/python/kernel_tests/math_ops/
Dtopk_op_test.py47 values_op, indices_op = nn_ops.top_k(inputs, k, sorted=sorted)
197 values, _ = nn_ops.top_k(inputs, k)
206 nn_ops.top_k(inputs, 4)
212 values, _ = nn_ops.top_k(inputs, 3)
239 op = nn_ops.top_k(v, k)
/external/tensorflow/tensorflow/lite/kernels/ctc/
Dctc_beam_search.h248 const bool top_k = in Step() local
251 const int max_classes = top_k ? label_selection_size_ : (num_classes_ - 1); in Step()
254 if (top_k) { in Step()
335 const int label = top_k ? top_k_indices[ind] : ind; in Step()
336 const float logit = top_k ? top_k_logits[ind] : raw_input(ind); in Step()
/external/tensorflow/tensorflow/python/compiler/tensorrt/test/
Dtopk_test.py31 values, indices = nn_ops.top_k(x, k_tensor, name="TopK")
52 values, indices = nn_ops.top_k(x, k_tensor, name="TopK")
/external/tensorflow/tensorflow/core/kernels/
Din_topk_op_test.cc36 static Graph* InTopK(int num_targets, int num_classes, T top_k) { in InTopK() argument
48 k_t.scalar<T>() = k_t.scalar<T>().constant(top_k); in InTopK()
Dtopk_op.cc197 std::unique_ptr<std::vector<int32>> top_k(filter.Extract()); in Compute() local
198 for (auto top_k_it = top_k->begin(); top_k_it != top_k->end(); in Compute()
/external/tensorflow/tensorflow/core/util/ctc/
Dctc_beam_search.h253 const bool top_k = in Step() local
257 top_k ? label_selection_size_ : (this->num_classes_ - 1); in Step()
260 if (top_k) { in Step()
340 const int label = top_k ? top_k_indices[ind] : ind; in Step()
341 const T logit = top_k ? top_k_logits[ind] : raw_input(ind); in Step()
/external/tensorflow/tensorflow/lite/examples/python/
Dlabel_image.py120 top_k = results.argsort()[-5:][::-1] variable
122 for i in top_k:
/external/tensorflow/tensorflow/examples/speech_commands/
Dlabel_wav.py64 top_k = predictions.argsort()[-num_top_predictions:][::-1]
65 for node_id in top_k:
Dlabel_wav_dir.py72 top_k = predictions.argsort()[-num_top_predictions:][::-1]
73 for node_id in top_k:
/external/tensorflow/tensorflow/lite/tools/evaluation/stages/
Dtopk_accuracy_eval_stage.cc108 std::vector<int> top_k = GetTopKIndices(probabilities, params.k()); in Run() local
109 UpdateCounts(top_k); in Run()
/external/tensorflow/tensorflow/examples/label_image/
Dlabel_image.py126 top_k = results.argsort()[-5:][::-1] variable
128 for i in top_k:
/external/tensorflow/tensorflow/compiler/tests/
Dsort_ops_test.py255 return nn_ops.top_k(v, k=k, sorted=True)
291 return nn_ops.top_k(v, k=k, sorted=True)
305 topk = nn_ops.top_k(p, k=4)
320 topk = nn_ops.top_k(p, k=6)
/external/ComputeLibrary/src/runtime/CPP/functions/
DCPPDetectionOutputLayer.cpp294 const float nms_threshold, const float eta, const int top_k, in ApplyNMSFast() argument
316 if(top_k > -1 && top_k < score_index_vec_size) in ApplyNMSFast()
318 score_index_vec.resize(top_k); in ApplyNMSFast()
510 …ores, _info.confidence_threshold(), _info.nms_threshold(), _info.eta(), _info.top_k(), indices[c]); in run()
/external/tensorflow/tensorflow/python/keras/
Dmetrics.py1306 top_k=None, argument
1312 self.top_k = top_k
1315 default_threshold = 0.5 if top_k is None else metrics_utils.NEG_INF
1352 top_k=self.top_k,
1370 'top_k': self.top_k,
1435 top_k=None, argument
1441 self.top_k = top_k
1444 default_threshold = 0.5 if top_k is None else metrics_utils.NEG_INF
1481 top_k=self.top_k,
1499 'top_k': self.top_k,
/external/tensorflow/tensorflow/lite/
Dsimple_memory_arena_debug_dump.cc85 TopKLayers(size_t top_k, size_t arena_size) in TopKLayers() argument
86 : top_k_(top_k), arena_size_(arena_size) {} in TopKLayers()
/external/tensorflow/tensorflow/python/keras/utils/
Dmetrics_utils.py509 top_k=None, argument
640 if top_k is not None:
641 y_pred = _filter_top_k(y_pred, top_k)
766 _, top_k_idx = nn_ops.top_k(x, k, sorted=False)

123