ott.solvers.utils.uniform_sampler#
- ott.solvers.utils.uniform_sampler(rng, num_samples, low=0.0, high=1.0, offset=None)[source]#
Sample from a uniform distribution.
Sample \(t\) from a uniform distribution \([low, high]\). If offset is not
None
, one element \(t\) is sampled from \([low, high]\) and the K samples are constructed via \((t + k)/K \mod (high - low - offset) + low\).- Parameters:
- Return type:
- Returns:
An array of shape
[num_samples, 1]
.