Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
newtype Generator (device :: Device (DeviceType Nat)) where Source #
UnsafeGenerator :: forall device. TVar (Either (SDevice device, Word64) (ForeignPtr Generator)) -> Generator device |
:: forall m device. MonadThrow m | |
=> SDevice device | generator device singleton |
-> Word64 | initial seed |
-> m (Generator device) | returned generator |
:: 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 #
class SGetGeneratorDevice (device :: Device (DeviceType Nat)) where Source #
sGetGenPtrDevice :: ForeignPtr Generator -> SDevice device Source #
Instances
SGetGeneratorDevice ('UncheckedDevice :: Device (DeviceType Nat)) Source # | |
Defined in Torch.GraduallyTyped.Random | |
SGetGeneratorDevice ('Device ('CPU :: DeviceType Nat)) Source # | |
Defined in Torch.GraduallyTyped.Random sGetGenPtrDevice :: ForeignPtr Generator -> SDevice ('Device 'CPU) Source # | |
KnownNat deviceIndex => SGetGeneratorDevice ('Device ('CUDA deviceIndex)) Source # | |
Defined in Torch.GraduallyTyped.Random sGetGenPtrDevice :: ForeignPtr Generator -> SDevice ('Device ('CUDA deviceIndex)) Source # |
:: forall device. SGetGeneratorDevice device | |
=> Generator device | input |
-> SDevice device | compute device of the input generator |
getGeneratorDeviceType Source #
:: forall device. SGetGeneratorDevice device | |
=> Generator device | input |
-> DeviceType Int16 | compute device of the input generator |
getGenPtr :: SGetGeneratorDevice device => TVar (Either (SDevice device, Word64) (ForeignPtr Generator)) -> IO (ForeignPtr Generator) Source #
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 #