Eager Random Tensors #
A session counter gives repeated seeded calls distinct keys, including calls after a tape reset. CPU and CUDA dispatch use the same key schedule.
def
Runtime.Autograd.Torch.Internal.EagerSession.randUniform
{α : Type}
[TorchLean.Storage α]
[Context α]
[TensorTransfer α]
(s : EagerSession α)
{sh : Spec.Shape}
(seed : ℕ)
(name : Option String := none)
:
Record a seeded uniform tensor using the session's next random key.
Instances For
def
Runtime.Autograd.Torch.Internal.EagerSession.bernoulliMask
{α : Type}
[TorchLean.Storage α]
[Context α]
[TensorTransfer α]
(s : EagerSession α)
{sh : Spec.Shape}
(keepProb : TensorRef α Spec.Shape.scalar)
(seed : ℕ)
(name : Option String := none)
:
Deterministic {0,1} mask generator (seeded) with a scalar keep-probability input.