IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo struct

Struct_keyed_uniform

struct Struct_keyed_uniform

Registers the sampler.keyed_uniform graph op.

Draws one uniform value in [0, 1) per row, keyed off that row's seed. mo.random.uniform reads index 0 of its seed tensor, so a caller that needs a row's draw to be independent of its co-residents -- speculative decoding's accept coin, keyed per (request, draft position) -- has no per-row seed to reach for. Op arity is fixed, so this is a separate registration rather than an extra operand on that one.

Implemented traitsโ€‹

AnyType, Deinitable, Movable

Methodsโ€‹

executeโ€‹

static def execute[target: StringSpan[ImmStaticOrigin], _trace_name: StringSpan[ImmStaticOrigin]](out_values: ManagedTensorSlice[IOSpec[_, _].Output, static_spec=out_values.static_spec], seed: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=seed.static_spec], ctx: DeviceContext)

Was this page helpful?