MCPcopy Create free account
hub / github.com/apache/tvm / randomFloat

Method randomFloat

web/src/support.ts:141–143  ·  view source on GitHub ↗

* Generates random float between (0, 1) non-inclusive, updating `rand_state`. * * Postcondition: pass `checkRandState()`, i.e. rand_state > 0 and is an integer.

()

Source from the content-addressed store, hash-verified

139 * Postcondition: pass `checkRandState()`, i.e. rand_state > 0 and is an integer.
140 */
141 randomFloat(): number {
142 return this.nextInt() / this.modulus;
143 }
144
145 private checkRandState(): void {
146 if (this.rand_state <= 0) {

Callers 4

uniformMethod · 0.80
sampleTopPFromLogitsMethod · 0.80
sampleTopPFromProbMethod · 0.80

Calls 1

nextIntMethod · 0.95

Tested by

no test coverage detected