hasktorch-gradually-typed-0.2.0.0: experimental project for hasktorch
Safe HaskellSafe-Inferred
LanguageHaskell2010

Torch.GraduallyTyped.Random

Documentation

newtype Generator (device :: Device (DeviceType Nat)) where Source #

Constructors

UnsafeGenerator :: forall device. TVar (Either (SDevice device, Word64) (ForeignPtr Generator)) -> Generator device 

sMkGenerator Source #

Arguments

:: forall m device. MonadThrow m 
=> SDevice device

generator device singleton

-> Word64

initial seed

-> m (Generator device)

returned generator

mkGenerator Source #

Arguments

:: forall m device. (SingI device, MonadThrow m) 
=> Word64

initial seed

-> m (Generator device)

returned generator

sSetGeneratorDevice :: forall m generatorDevice' generatorDevice. MonadThrow m => SDevice generatorDevice' -> Generator generatorDevice -> m (Generator generatorDevice') Source #

setGeneratorDevice :: forall m generatorDevice' generatorDevice. (SingI generatorDevice', MonadThrow m) => Generator generatorDevice -> m (Generator generatorDevice') Source #

sGetGeneratorDevice Source #

Arguments

:: forall device. SGetGeneratorDevice device 
=> Generator device

input

-> SDevice device

compute device of the input generator

getGeneratorDeviceType Source #

Arguments

:: forall device. SGetGeneratorDevice device 
=> Generator device

input

-> DeviceType Int16

compute device of the input generator

sCreateWithGenerator :: forall m gradient layout device dataType shape generatorDevice. (SGetGeneratorDevice generatorDevice, MonadThrow m) => TensorSpec gradient layout device dataType shape -> Generator generatorDevice -> (ForeignPtr TensorOptions -> [Dim String Integer] -> ForeignPtr Generator -> IO (ForeignPtr Tensor)) -> m (Tensor gradient layout (device <+> generatorDevice) dataType shape, Generator (device <+> generatorDevice)) Source #

sForwardWithGenerator :: forall m gradient layout device dataType shape generatorDevice. (SGetGeneratorDevice generatorDevice, MonadThrow m) => Tensor gradient layout device dataType shape -> Generator generatorDevice -> (ForeignPtr Tensor -> ForeignPtr Generator -> IO (ForeignPtr Tensor)) -> m (Tensor gradient layout (device <+> generatorDevice) dataType shape, Generator (device <+> generatorDevice)) Source #