/aosp_15_r20/test/mlts/models/assets/models_list/ |
D | mobilenet_topk_aosp.json | 8 "className": "TopK", 25 "className": "TopK", 44 "className": "TopK", 61 "className": "TopK", 80 "className": "TopK", 97 "className": "TopK", 116 "className": "TopK", 133 "className": "TopK", 152 "className": "TopK", 169 "className": "TopK", [all …]
|
/aosp_15_r20/external/tensorflow/tensorflow/core/tpu/kernels/ |
H A D | topk_ops.cc | 123 // Returns the TopK unique values in the array in sorted order and the 133 // returned. If a TopK element never appears in the input due to 146 // TopK with reasonable semantics. 219 auto topk = CreateTopKUnique(builder, input, input_shape, k_, false); in Compile() local 220 ctx->SetOutput(0, topk.first); in Compile() 221 ctx->SetOutput(1, topk.second); in Compile() 234 // suppressing identical elements. For most TopK users, the indices of 235 // the TopK elements are important but the relative order of the TopK 237 // the indices of the TopK elements of the output of MakeUnique are 238 // the same as the indices of the TopK elements of the inputs. [all …]
|
/aosp_15_r20/external/tensorflow/tensorflow/compiler/xla/service/spmd/ |
H A D | custom_call_handler.cc | 123 // Each partition needs to do TopK separately, thus the base shape in HandleCustomCallTopK() 133 auto topk = b_.AddInstruction( in HandleCustomCallTopK() local 135 topk->set_sharding(custom_call_sharding); in HandleCustomCallTopK() 137 PartitionedHlo partitioned_topk(topk, replicated_shape, in HandleCustomCallTopK() 139 topk = partitioned_topk.hlo(); in HandleCustomCallTopK() 141 // Get value from TopK. in HandleCustomCallTopK() 144 topk->shape().tuple_shapes(0), topk, 0)); in HandleCustomCallTopK() 154 // Get index from TopK. in HandleCustomCallTopK() 157 topk->shape().tuple_shapes(1), topk, 1)); in HandleCustomCallTopK() 181 // Creates replicated sort to do TopK, the input is value and index pairs in HandleCustomCallTopK() [all …]
|
/aosp_15_r20/external/pytorch/aten/src/ATen/native/cuda/ |
H A D | TensorTopK.cu | 48 at::cuda::detail::TensorInfo<T, IndexType> topK, in gatherTopK() argument 70 at::cuda::detail::IndexToOffset<T, IndexType, Dim>::get(slice, topK); in gatherTopK() 75 T* topKSliceStart = &topK.data[topKSliceStartIndex]; in gatherTopK() 190 at::cuda::detail::TensorInfo<T, IndexType> topK, in launch() argument 197 TORCH_INTERNAL_ASSERT(getGridFromTiles(numInputSlices, grid), "Too many slices for topk"); in launch() 207 topK, in launch() 246 // for largest topk, k_to_find = slice_size - k + 1 504 at::cuda::detail::TensorInfo<T, IndexType> topK, in C10_LAUNCH_BOUNDS_1() 542 at::cuda::detail::IndexToOffset<T, IndexType, Dim>::get(slice_idx, topK); in C10_LAUNCH_BOUNDS_1() 547 T* topKSliceStart = &topK.data[topKSliceStartIndex]; in C10_LAUNCH_BOUNDS_1() [all …]
|
/aosp_15_r20/external/guava/android/guava-tests/test/com/google/common/collect/ |
H A D | TopKSelectorTest.java | 66 assertThat(top.topK()).isEmpty(); in testZeroK() 71 assertThat(top.topK()).isEmpty(); in testNoElementsOffered() 79 assertThat(top.topK()).containsExactly(2, 3, 5).inOrder(); in testOfferedFewerThanK() 86 assertThat(top.topK()).containsExactly(1, 2, 3, 4).inOrder(); in testOfferedKPlusOne() 94 assertThat(top.topK()).containsExactly(1, 2).inOrder(); in testOfferedThreeK() 101 assertThat(top.topK()).containsExactly("a", "B", "c").inOrder(); in testDifferentComparator() 121 assertThat(top.topK()).containsExactlyElementsIn(Collections.nCopies(k, 0)); in testWorstCase() 131 assertThat(top.topK()).isEqualTo(Ints.asList(0, 0, 0, 0, 0, 0, 0)); in testExceedMaxIteration()
|
/aosp_15_r20/external/guava/guava-tests/test/com/google/common/collect/ |
H A D | TopKSelectorTest.java | 66 assertThat(top.topK()).isEmpty(); in testZeroK() 71 assertThat(top.topK()).isEmpty(); in testNoElementsOffered() 79 assertThat(top.topK()).containsExactly(2, 3, 5).inOrder(); in testOfferedFewerThanK() 86 assertThat(top.topK()).containsExactly(1, 2, 3, 4).inOrder(); in testOfferedKPlusOne() 94 assertThat(top.topK()).containsExactly(1, 2).inOrder(); in testOfferedThreeK() 101 assertThat(top.topK()).containsExactly("a", "B", "c").inOrder(); in testDifferentComparator() 121 assertThat(top.topK()).containsExactlyElementsIn(Collections.nCopies(k, 0)); in testWorstCase() 131 assertThat(top.topK()).isEqualTo(Ints.asList(0, 0, 0, 0, 0, 0, 0)); in testExceedMaxIteration()
|
/aosp_15_r20/external/executorch/exir/tests/ |
H A D | test_op_convert.py | 21 "aten::topk", 27 op_overload = torch.ops.aten.topk.values 32 op_overload = torch.ops.aten.topk.default 38 self.assertTrue(out_var_op is not torch.ops.aten.topk.default) 39 self.assertTrue(out_var_op is torch.ops.aten.topk.values) 62 aten.topk.default: (aten.topk.values, ("values", "indices")),
|
/aosp_15_r20/external/tensorflow/tensorflow/compiler/xla/client/lib/ |
H A D | sorting.cc | 28 XlaOp TopK(XlaOp input, int64_t k) { in TopK() function 115 // The k in TopK is static so we shouldn't generate a dynamic dimension in TopK() 141 // The k in TopK is static so we shouldn't generate a dynamic dimension in TopK() 163 // Do normal TopK when per partition size is smaller than or equal to k. in TopKWithPartitions() 165 return TopK(input, k); in TopKWithPartitions() 206 // Slice topk. in TopKWithPartitions() 216 // Get the values and indices for the first topk so that they can in TopKWithPartitions() 234 // Slice topk. in TopKWithPartitions() 242 // Pass the result of the first TopK to the while loop and do in TopKWithPartitions()
|
H A D | sorting_test.cc | 35 xla::GetTupleElement(xla::TopK(x, 3), 0); in XLA_TEST_F() 43 xla::GetTupleElement(xla::TopK(x_rev, 3), 1); in XLA_TEST_F() 52 xla::GetTupleElement(xla::TopK(x_rev, 3), 1); in XLA_TEST_F() 65 xla::GetTupleElement(xla::TopK(x, kSize), 0); in XLA_TEST_F() 75 xla::GetTupleElement(xla::TopK(a, 5), 1); in XLA_TEST_F() 129 xla::GetTupleElement(xla::TopK(x, 1000), 0); in XLA_TEST_F()
|
/aosp_15_r20/external/pytorch/test/ |
H A D | test_sort_and_select.py | 321 torch.topk(tensor, 6, sorted=sorted, out=(values, indices)) 322 values_cont, indices_cont = tensor.topk(6, sorted=sorted) 461 # gather from the input using the topk indices and compare against 467 topKVal, topKInd = t.topk(k, dim, dir, True) 496 # This tests the code path where on CUDA, topk is implemented with sort. 501 # This tests the code path where on CUDA, topk is implemented with multiblock 507 # Calling topk on a quantized scalar input used to segfault, 510 x.topk(1) 515 self.assertRaises(TypeError, lambda: q.topk(4, True)) 803 # test different topk paths on cuda [all …]
|
/aosp_15_r20/test/mlts/benchmark/src/com/android/nn/benchmark/evaluators/ |
D | TopK.java | 35 public class TopK implements EvaluatorInterface { class 50 int[] topk = new int[K_TOP]; in EvaluateAccuracy() local 54 throw new IllegalArgumentException("Needs mInferenceOutput for TopK"); in EvaluateAccuracy() 59 "supported by TopK evaluator"); in EvaluateAccuracy() 90 topk[k]++; in EvaluateAccuracy() 96 outValues.add(new Float((float) topk[i] / (float) total)); in EvaluateAccuracy() 100 float top1 = ((float) topk[0] / (float) total); in EvaluateAccuracy()
|
/aosp_15_r20/test/mlts/benchmark/results/ |
D | generate_result.py | 248 """Are these evaluator keys from TopK evaluator?""" 296 topk = [TOPK_BASELINE_TEMPLATE.format(val=x) for x in val] 298 top1=topk[0], top2=topk[1], top3=topk[2], top4=topk[3], 299 top5=topk[4] 304 topk = [TOPK_DIFF_TEMPLATE.format( 308 top1=topk[0], top2=topk[1], top3=topk[2], top4=topk[3], 309 top5=topk[4]
|
/aosp_15_r20/external/tensorflow/tensorflow/lite/kernels/ |
H A D | topk_v2.cc | 51 "TopK k input must have 1 or more dimensions."); in ResizeOutput() 54 "TopK k is higher than the internal dimension."); in ResizeOutput() 177 void TopK(int32 row_size, int32 num_rows, const T* data, int32 k, in TopK() function 257 TopK(row_size, num_rows, GetTensorData<float>(input), k, in Eval() 261 TopK(row_size, num_rows, input->data.uint8, k, output_indexes->data.i32, in Eval() 265 TopK(row_size, num_rows, input->data.int8, k, output_indexes->data.i32, in Eval() 269 TopK(row_size, num_rows, input->data.i32, k, output_indexes->data.i32, in Eval() 273 TopK(row_size, num_rows, input->data.i64, k, output_indexes->data.i32, in Eval() 277 TF_LITE_KERNEL_LOG(context, "Type %s is currently not supported by TopK.", in Eval()
|
/aosp_15_r20/external/pytorch/android/test_app/app/src/main/java/org/pytorch/testapp/ |
H A D | Utils.java | 7 public static int[] topK(float[] a, final int topk) { in topK() method in Utils 8 float values[] = new float[topk]; in topK() 10 int ixs[] = new int[topk]; in topK() 14 for (int j = 0; j < topk; j++) { in topK() 16 for (int k = topk - 1; k >= j + 1; k--) { in topK()
|
/aosp_15_r20/external/tensorflow/tensorflow/compiler/xla/service/ |
H A D | topk_rewriter.cc | 155 // Non-slice user means we are not doing a TopK in SortIsInTopK() 191 // Check if sort is in TopK. in TransformToCustomCall() 233 HloInstruction* topk = comp->AddInstruction( in TransformToCustomCall() local 234 HloInstruction::CreateCustomCall(topk_shape, {input}, "TopK")); in TransformToCustomCall() 237 topk->shape().tuple_shapes(0), topk, 0)); in TransformToCustomCall() 240 topk->shape().tuple_shapes(1), topk, 1)); in TransformToCustomCall() 261 "topk rewriter"; in TransformToCustomCall()
|
H A D | topk_rewriter.h | 25 // This pass pattern-matches soups of HLOs executing a TopK operation and 26 // replaces them with a TopK CustomCall when the given values are supported by 34 absl::string_view name() const override { return "topk-rewriter"; } in name() 42 // Check if the sort instruction is in TopK. 51 // Check if the sort instruction is in TopK.
|
/aosp_15_r20/external/tensorflow/tensorflow/core/kernels/ |
H A D | topk_op.cc | 40 class TopK : public OpKernel { class 42 explicit TopK(OpKernelConstruction* context) : OpKernel(context) { in TopK() function in tensorflow::TopK 44 if (num_inputs() < 2) { // k is an attr (TopK). in TopK() 244 TopK<CPUDevice, type>) 247 REGISTER_KERNELS_NAME(TopK, type); \ 275 Name("TopK").Device(DEVICE_GPU).TypeConstraint<type>("T"), \ 276 TopK<GPUDevice, type>) \ 281 TopK<GPUDevice, type>)
|
/aosp_15_r20/external/guava/guava/src/com/google/common/collect/ |
H A D | TopKSelector.java | 46 * #offer} and a call to {@link #topK}, with O(k) memory. In comparison, quickselect has the same 63 * relative to the natural ordering of the elements, and returns them via {@link #topK} in 74 * relative to the specified comparator, and returns them via {@link #topK} in ascending order. 85 * relative to the natural ordering of the elements, and returns them via {@link #topK} in 96 * relative to the specified comparator, and returns them via {@link #topK} in descending order. 276 public List<T> topK() { in topK() method in TopKSelector 286 T[] topK = Arrays.copyOf(castBuffer, bufferSize); in topK() local 288 return Collections.unmodifiableList(Arrays.asList(topK)); in topK()
|
/aosp_15_r20/external/guava/android/guava/src/com/google/common/collect/ |
H A D | TopKSelector.java | 45 * #offer} and a call to {@link #topK}, with O(k) memory. In comparison, quickselect has the same 62 * relative to the natural ordering of the elements, and returns them via {@link #topK} in 73 * relative to the specified comparator, and returns them via {@link #topK} in ascending order. 84 * relative to the natural ordering of the elements, and returns them via {@link #topK} in 95 * relative to the specified comparator, and returns them via {@link #topK} in descending order. 275 public List<T> topK() { in topK() method in TopKSelector 285 T[] topK = Arrays.copyOf(castBuffer, bufferSize); in topK() local 287 return Collections.unmodifiableList(Arrays.asList(topK)); in topK()
|
/aosp_15_r20/external/tensorflow/tensorflow/compiler/tests/ |
H A D | sort_ops_test.py | 254 def topk(v, k=k): function 258 topk, [x.astype(dtype)], 290 def topk(v, k=k): function 294 topk, [x.astype(dtype)], 305 topk = nn_ops.top_k(p, k=4) 307 topk, 320 topk = nn_ops.top_k(p, k=6) 321 results = sess.run(topk, {
|
/aosp_15_r20/external/executorch/backends/qualcomm/builders/ |
H A D | op_topk.py | 20 class TopK(NodeVisitor): class 21 target = ["aten.topk.default"] 52 … "[QNN Delegate Op Builder]: QNN currently only supports channel as dimension for topK.", 62 # QNN constraint, topk output_0 requires having the same quant config as input 72 # topk output_1 is index, do not quantize it.
|
/aosp_15_r20/external/tensorflow/tensorflow/python/compiler/tensorrt/test/ |
H A D | topk_test.py | 31 values, indices = nn_ops.top_k(x, k_tensor, name="TopK") 43 return {"TRTEngineOp_000": ["Const", "TopK"]} 52 values, indices = nn_ops.top_k(x, k_tensor, name="TopK") 53 # Reshape will act as a layer between the TopK output and the engine 68 return {"TRTEngineOp_000": ["Const", "TopK", "Reshape", "Reshape/shape"]}
|
/aosp_15_r20/external/pytorch/test/quantization/core/experimental/ |
H A D | quantization_util.py | 55 def accuracy(output, target, topk=(1,)): argument 58 maxk = max(topk) 61 _, pred = output.topk(maxk, 1, True, True) 66 for k in topk: 80 acc1, acc5 = accuracy(output, target, topk=(1, 5))
|
/aosp_15_r20/external/pytorch/torch/nn/utils/ |
H A D | prune.py | 467 topk = torch.topk(prob.view(-1), k=nparams_toprune) 468 mask.view(-1)[topk.indices] = 0 525 topk = torch.topk(torch.abs(t).view(-1), k=nparams_toprune, largest=False) 526 # topk will have .indices and .values 527 mask.view(-1)[topk.indices] = 0 616 # 1s wherever topk.indices indicates, along self.dim. 724 # L_n norm along each channel to then find the topk based on this 729 topk = torch.topk(norm, k=nparams_tokeep, largest=True) 730 # topk will have .indices and .values 733 # 1s wherever topk.indices indicates, along self.dim. [all …]
|
/aosp_15_r20/external/pytorch/torch/utils/bottleneck/ |
H A D | __main__.py | 88 def print_cprofile_summary(prof, sortby='tottime', topk=15): argument 91 cprofile_stats.print_stats(topk) 120 def print_autograd_prof_summary(prof, mode, sortby='cpu_time', topk=15): argument 138 topk_events = sorted_events[:topk] 142 'description': f'top {topk} events sorted by {sortby}',
|