Instance Propertyswift-transformers 0.1.17TensorUtils
p
TopPLogitsWarper.swift:7var p: Float
var p: Float
import TensorUtils
struct TopPLogitsWarper
Top-P. Select the smallest set of elements whose cumulative probability exceeds the probability p
. Based on https://gist.github.com/thomwolf/1a5a29f6962089e871b94cbd09daf317
@frozen struct Float
A single-precision, floating-point value type.
init(p: Float)
func warp(indices: [Int], logits: [Float]) -> (indices: [Int], logits: [Float])