Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
class HasToDevice (device' :: (DeviceType, Nat)) (device :: (DeviceType, Nat)) (f :: Type) (g :: Type) | device' device f -> g, device' device g -> f where Source #
Instances
HasToDevice device' device Double Double Source # | |
(g ~ ReplaceDevice f device' device, f ~ ReplaceDevice g device device', Generic f, Generic g, GHasToDevice device' device (Rep f) (Rep g)) => HasToDevice device' device f g Source # | |
Defined in Torch.Typed.Device | |
(HasToDevice device' device x x', HasToDevice device' device (HList xs) (HList xs')) => HasToDevice device' device (HList (x ': xs)) (HList (x' ': xs')) Source # | |
HasToDevice device' device (HList ('[] :: [Type])) (HList ('[] :: [Type])) Source # | |
KnownDevice device' => HasToDevice device' device (Parameter device dtype shape) (Parameter device' dtype shape) Source # | |
KnownDevice device' => HasToDevice device' device (Tensor device dtype shape) (Tensor device' dtype shape) Source # | |
type family ReplaceDevice (f :: k) (device' :: (DeviceType, Nat)) (device :: (DeviceType, Nat)) :: k where ... Source #
ReplaceDevice (t device) device' device = t device' | |
ReplaceDevice (t a) device' device = ReplaceDevice t device' device (ReplaceDevice a device' device) | |
ReplaceDevice t _ _ = t |
type family ReplaceDevice' (f :: k) (device' :: (DeviceType, Nat)) :: k where ... Source #
ReplaceDevice' (t (device :: (DeviceType, Nat))) device' = t device' | |
ReplaceDevice' (t a) device' = ReplaceDevice' t device' (ReplaceDevice' a device') | |
ReplaceDevice' t _ = t |
class GHasToDevice (device' :: (DeviceType, Nat)) (device :: (DeviceType, Nat)) (f :: Type -> Type) (g :: Type -> Type) where Source #
Instances
GHasToDevice device' device (U1 :: Type -> Type) (U1 :: Type -> Type) Source # | |
(GHasToDevice device' device l l', GHasToDevice device' device r r') => GHasToDevice device' device (l :*: r) (l' :*: r') Source # | |
HasToDevice device' device f g => GHasToDevice device' device (K1 i f :: Type -> Type) (K1 i g :: Type -> Type) Source # | |
GHasToDevice device' device f g => GHasToDevice device' device (M1 i t f) (M1 i t g) Source # | |
class HasReplicate (devices' :: [(DeviceType, Nat)]) (device :: (DeviceType, Nat)) (f :: Type) (gs :: [Type]) | devices' device f -> gs where Source #
Instances
HasReplicate ('[] :: [(DeviceType, Nat)]) device f ('[] :: [Type]) Source # | |
Defined in Torch.Typed.Device | |
(HasReplicate devices' device f gs, HasToDevice device' device f g) => HasReplicate (device' ': devices') device f (g ': gs) Source # | |
Defined in Torch.Typed.Device |
class HasToDevices (devices' :: [(DeviceType, Nat)]) (devices :: [(DeviceType, Nat)]) (fs :: [Type]) (gs :: [Type]) | devices' devices fs -> gs, devices' devices gs -> fs where Source #
Instances
HasToDevices ('[] :: [(DeviceType, Nat)]) ('[] :: [(DeviceType, Nat)]) ('[] :: [Type]) ('[] :: [Type]) Source # | |
(HasToDevices devices' devices fs gs, HasToDevice device' device f g) => HasToDevices (device' ': devices') (device ': devices) (f ': fs) (g ': gs) Source # | |
type family GetDevices (fs :: [k]) :: [(DeviceType, Nat)] where ... Source #
GetDevices '[] = '[] | |
GetDevices (f ': fs) = MaybePrepend (GetDevice f) (GetDevices fs) |
class HasScatter devices' device f gs | devices' device f -> gs where Source #
Instances
(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 # | |
class HasGather device' devices fs g | device' devices fs -> g where Source #
Instances
(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 # | |