Home
last modified time | relevance | path

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

12

/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()
190 const auto& top_k = topc.sorted_result(); in TopK() local
191 std::copy(top_k.begin(), top_k.end(), indexes_row); in TopK()
192 std::transform(top_k.begin(), top_k.end(), output_row, in TopK()
211 const TfLiteTensor* top_k; in Prepare() local
212 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
47 top_k_ = AddConstInput(TensorType_INT32, {top_k}, {1}); in TopKV2OpModel()
56 PopulateTensor<int32_t>(top_k_, {top_k}); in TopKV2OpModel()
/external/tensorflow/tensorflow/python/kernel_tests/
Dtopk_op_test.py51 values_op, indices_op = nn_ops.top_k(inputs, k, sorted=sorted)
201 values, _ = nn_ops.top_k(inputs, k)
210 nn_ops.top_k(inputs, 4)
216 values, _ = nn_ops.top_k(inputs, 3)
243 op = nn_ops.top_k(v, k)
/external/tensorflow/tensorflow/lite/experimental/kernels/
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.py35 values, indices = nn_ops.top_k(x, k_tensor, name="TopK")
56 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.cc191 std::unique_ptr<std::vector<int32>> top_k(filter.Extract()); in Compute() local
192 for (auto top_k_it = top_k->begin(); top_k_it != top_k->end(); in Compute()
/external/tensorflow/tensorflow/lite/examples/python/
Dlabel_image.py93 top_k = results.argsort()[-5:][::-1] variable
95 for i in top_k:
/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/tools/evaluation/stages/
Dtopk_accuracy_eval_stage.cc106 std::vector<int> top_k = GetTopKIndices(probabilities, params.k()); in Run() local
107 UpdateCounts(top_k); in Run()
/external/tensorflow/tensorflow/examples/speech_commands/
Dlabel_wav_dir.py76 top_k = predictions.argsort()[-num_top_predictions:][::-1]
77 for node_id in top_k:
Dlabel_wav.py68 top_k = predictions.argsort()[-num_top_predictions:][::-1]
69 for node_id in top_k:
/external/tensorflow/tensorflow/python/keras/utils/
Dmetrics_utils.py240 top_k=None, argument
355 if top_k is not None:
356 y_pred = _filter_top_k(y_pred, top_k)
473 _, top_k_idx = nn_ops.top_k(x, k, sorted=False)
/external/tensorflow/tensorflow/examples/label_image/
Dlabel_image.py135 top_k = results.argsort()[-5:][::-1] variable
137 for i in top_k:
/external/tensorflow/tensorflow/python/keras/
Dmetrics.py1271 top_k=None, argument
1277 self.top_k = top_k
1280 default_threshold = 0.5 if top_k is None else metrics_utils.NEG_INF
1314 top_k=self.top_k,
1331 'top_k': self.top_k,
1396 top_k=None, argument
1402 self.top_k = top_k
1405 default_threshold = 0.5 if top_k is None else metrics_utils.NEG_INF
1439 top_k=self.top_k,
1456 'top_k': self.top_k,
Dmetrics_confusion_matrix_test.py328 name='my_precision', thresholds=[0.4, 0.9], top_k=15, class_id=12)
334 self.assertEqual(p_obj.top_k, 15)
342 self.assertEqual(p_obj2.top_k, 15)
446 p_obj = metrics.Precision(top_k=3)
454 p_obj = metrics.Precision(top_k=3)
499 p_obj = metrics.Precision(class_id=2, top_k=2)
517 p_obj = metrics.Precision(thresholds=.7, top_k=2)
533 name='my_recall', thresholds=[0.4, 0.9], top_k=15, class_id=12)
539 self.assertEqual(r_obj.top_k, 15)
547 self.assertEqual(r_obj2.top_k, 15)
[all …]
/external/tensorflow/tensorflow/compiler/tests/
Dsort_ops_test.py265 return nn_ops.top_k(v, k=k, sorted=True)
302 return nn_ops.top_k(v, k=k, sorted=True)
319 topk = nn_ops.top_k(p, k=4)
337 topk = nn_ops.top_k(p, k=6)
/external/tensorflow/tensorflow/lite/testing/op_tests/
Dtopk.py49 out = tf.nn.top_k(input_value, k)
/external/tensorflow/tensorflow/python/ops/
Dsort_ops.py233 values, indices = nn_ops.top_k(top_k_input, k)
/external/tensorflow/tensorflow/tools/api/golden/v1/
Dtensorflow.keras.metrics.-precision.pbtxt133 …argspec: "args=[\'self\', \'thresholds\', \'top_k\', \'class_id\', \'name\', \'dtype\'], varargs=N…
Dtensorflow.keras.metrics.-recall.pbtxt133 …argspec: "args=[\'self\', \'thresholds\', \'top_k\', \'class_id\', \'name\', \'dtype\'], varargs=N…
/external/tensorflow/tensorflow/tools/api/golden/v2/
Dtensorflow.metrics.-recall.pbtxt133 …argspec: "args=[\'self\', \'thresholds\', \'top_k\', \'class_id\', \'name\', \'dtype\'], varargs=N…
Dtensorflow.metrics.-precision.pbtxt133 …argspec: "args=[\'self\', \'thresholds\', \'top_k\', \'class_id\', \'name\', \'dtype\'], varargs=N…
Dtensorflow.keras.metrics.-recall.pbtxt133 …argspec: "args=[\'self\', \'thresholds\', \'top_k\', \'class_id\', \'name\', \'dtype\'], varargs=N…
/external/tensorflow/tensorflow/compiler/aot/tests/
Dmake_test_graphs.py154 output = nn_ops.top_k(x, 2, name='values')

12