Mojo function
TopKSoftmaxSampleKernel
TopKSoftmaxSampleKernel[block_size: Int, vec_size: Int, dtype: DType, out_idx_type: DType, logits_layout: Layout, sampled_indices_layout: Layout](logits: LayoutTensor[dtype, logits_layout, MutAnyOrigin], sampled_indices: LayoutTensor[out_idx_type, sampled_indices_layout, MutAnyOrigin], top_k_arr: LegacyUnsafePointer[Scalar[out_idx_type]], top_k_val: Int, temperature_val: Float32, temperature: LegacyUnsafePointer[Float32], seed_val: UInt64, seed: LegacyUnsafePointer[UInt64], d: Int)
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!