Skip to main content

Python module

sampling

Sampling custom ops.

MinPSampler

class max.nn.sampling.MinPSampler(dtype, shape, temperature=1)

A min_p sampler.

Parameters:

dtype

dtype: DType

min_p

min_p: float

shape

shape: Shape

temperature

temperature: float

RejectionSampler

class max.nn.sampling.RejectionSampler(device, top_k=1, top_p=1, temperature=1.0, seed=0, eps=1e-05)

A simple rejection sampler.

Parameters:

RejectionSamplerWithResiduals

class max.nn.sampling.RejectionSamplerWithResiduals(device, top_k=1, temperature=1.0, eps=1e-10, seed=0, debug=False)

A simple rejection sampler.

Parameters:

Was this page helpful?