Sample element-wise from .
Parameters
inputTensorNon-negative rates per output position. Any
shape.
Override Lucid's default Philox generator with an isolated
stream. When
None (default), draws are controlled by
manual_seed.Returns
Tensorint64 tensor with the same shape as input. Zero rates
always return zero.
Raises
ValueErrorIf any element of
input is negative.Notes
Two-branch implementation:
- Knuth's multiplication method for
rate < 30— exact but runtime grows with the rate. - Normal approximation
for
rate >= 30— bias < 0.05 standard deviations, orders of magnitude faster than Knuth in the tail.