Skip to main content

Mojo function

TopKSoftmaxSampleKernel

TopKSoftmaxSampleKernel[block_size: Int, vec_size: Int, dtype: DType, out_idx_type: DType, LogitsLayoutType: TensorLayout, logits_origin: ImmutOrigin, SampledLayoutType: TensorLayout, sampled_origin: MutOrigin](logits: TileTensor[dtype, LogitsLayoutType, logits_origin], sampled_indices: TileTensor[out_idx_type, SampledLayoutType, sampled_origin], top_k_arr: UnsafePointer[Scalar[out_idx_type], MutExternalOrigin], top_k_val: Int, temperature_val: Float32, temperature: UnsafePointer[Float32, MutExternalOrigin], seed_val: UInt64, seed: UnsafePointer[UInt64, MutExternalOrigin], d: Int)

Was this page helpful?