hasktorch-0.2.0.0: Functional differentiable programming in Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Torch.Device

Documentation

data DeviceType Source #

Constructors

CPU 
CUDA 

Instances

Instances details
Show DeviceType Source # 
Instance details

Defined in Torch.Device

Eq DeviceType Source # 
Instance details

Defined in Torch.Device

Ord DeviceType Source # 
Instance details

Defined in Torch.Device

Castable DeviceType DeviceType Source # 
Instance details

Defined in Torch.Device

Methods

cast :: DeviceType -> (DeviceType0 -> IO r) -> IO r Source #

uncast :: DeviceType0 -> (DeviceType -> IO r) -> IO r Source #

HasToDevice device' device (HList xs) (HList ys) => ReduceGradients device' '[device] ('[HList xs] :: [Type]) (ys :: [k]) Source # 
Instance details

Defined in Torch.Typed.NN.DataParallel

Methods

reduceGradients :: HList '[HList xs] -> HList ys Source #

(HasToDevice device' device (HList xs) (HList ys), ReduceGradients device' devices xxs ys, HZipWith SumF ys ys ys, 1 <= ListLength xxs) => ReduceGradients device' (device ': devices) (HList xs ': xxs :: [Type]) (ys :: [k]) Source # 
Instance details

Defined in Torch.Typed.NN.DataParallel

Methods

reduceGradients :: HList (HList xs ': xxs) -> HList ys Source #

HasReplicate ('[] :: [(DeviceType, Nat)]) device f ('[] :: [Type]) Source # 
Instance details

Defined in Torch.Typed.Device

Methods

replicate :: f -> HList '[] Source #

HasToDevices ('[] :: [(DeviceType, Nat)]) ('[] :: [(DeviceType, Nat)]) ('[] :: [Type]) ('[] :: [Type]) Source # 
Instance details

Defined in Torch.Typed.Device

Methods

toDevices :: HList '[] -> HList '[] Source #

(chunks ~ ListLength devices', tensorChunks ~ (Chunk chunks 0 shape dtype device :: [Type]), Castable (HList tensorChunks) [ATenTensor], devices ~ HReplicateR chunks device, HasToDevices devices' devices tensorChunks gs, KnownNat chunks) => HasScatter (devices' :: [(DeviceType, Nat)]) (device :: (DeviceType, Nat)) (Tensor device dtype shape) (gs :: [Type]) Source # 
Instance details

Defined in Torch.Typed.Device

Methods

scatter :: Tensor device dtype shape -> HList gs Source #

(HZipWithM Concurrently GradConcurrentlyF parameters losses gradients', ReduceGradients device' devices gradients' gradients) => HasGradConcurrently (device' :: (DeviceType, Nat)) (devices :: [(DeviceType, Nat)]) (parameters :: [k1]) (losses :: [k1]) (gradients :: [k2]) Source # 
Instance details

Defined in Torch.Typed.NN.DataParallel

Methods

gradConcurrently :: HList parameters -> HList losses -> Concurrently (HList gradients) Source #

(chunks ~ ListLength fs, devices ~ GetDevices fs, devices' ~ HReplicateR chunks device', HasToDevices devices' devices fs tensorChunks, '(shape, dtype, device') ~ Cat 0 tensorChunks, Castable (HList tensorChunks) [ATenTensor]) => HasGather (device' :: (DeviceType, Nat)) (devices :: [(DeviceType, Nat)]) (fs :: [Type]) (Tensor device' dtype shape) Source # 
Instance details

Defined in Torch.Typed.Device

Methods

gather :: HList fs -> Tensor device' dtype shape Source #

(HasReplicate devices' device f gs, HasToDevice device' device f g) => HasReplicate (device' ': devices') device f (g ': gs) Source # 
Instance details

Defined in Torch.Typed.Device

Methods

replicate :: f -> HList (g ': gs) Source #

(HasToDevices devices' devices fs gs, HasToDevice device' device f g) => HasToDevices (device' ': devices') (device ': devices) (f ': fs) (g ': gs) Source # 
Instance details

Defined in Torch.Typed.Device

Methods

toDevices :: HList (f ': fs) -> HList (g ': gs) Source #

KnownNat n => KnownDevice '('CPU, n) Source # 
Instance details

Defined in Torch.Typed.Tensor

KnownNat n => KnownDevice '('CUDA, n) Source # 
Instance details

Defined in Torch.Typed.Tensor