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

Torch.Typed.DType

Documentation

class HasToDType dtype' dtype f g | dtype' dtype f -> g, dtype' dtype g -> f where Source #

Methods

toDType :: f -> g Source #

Instances

Instances details
(g ~ ReplaceDType f dtype' dtype, f ~ ReplaceDType g dtype dtype', Generic f, Generic g, GHasToDType dtype' dtype (Rep f) (Rep g)) => HasToDType (dtype' :: DType) (dtype :: DType) f g Source # 
Instance details

Defined in Torch.Typed.DType

Methods

toDType :: f -> g Source #

KnownDType dtype' => HasToDType (dtype' :: DType) (dtype :: DType) (Parameter device dtype shape) (Parameter device dtype' shape) Source # 
Instance details

Defined in Torch.Typed.DType

Methods

toDType :: Parameter device dtype shape -> Parameter device dtype' shape Source #

KnownDType dtype' => HasToDType (dtype' :: DType) (dtype :: DType) (Tensor device dtype shape) (Tensor device dtype' shape) Source # 
Instance details

Defined in Torch.Typed.DType

Methods

toDType :: Tensor device dtype shape -> Tensor device dtype' shape Source #

type family ReplaceDType (f :: k) (dtype' :: DType) (dtype :: DType) :: k where ... Source #

Equations

ReplaceDType (t dtype) dtype' dtype = t dtype' 
ReplaceDType (t a) dtype' dtype = ReplaceDType t dtype' dtype (ReplaceDType a dtype' dtype) 
ReplaceDType t _ _ = t 

type family ReplaceDType' (f :: k) (dtype' :: DType) :: k where ... Source #

Equations

ReplaceDType' (t (dtype :: DType)) dtype' = t dtype' 
ReplaceDType' (t a) dtype' = ReplaceDType' t dtype' (ReplaceDType' a dtype') 
ReplaceDType' t _ = t 

class GHasToDType (dtype' :: DType) (dtype :: DType) (f :: Type -> Type) (g :: Type -> Type) where Source #

Methods

gToDType :: forall a. f a -> g a Source #

Instances

Instances details
GHasToDType dtype' dtype (U1 :: Type -> Type) (U1 :: Type -> Type) Source # 
Instance details

Defined in Torch.Typed.DType

Methods

gToDType :: U1 a -> U1 a Source #

(GHasToDType dtype' dtype l l', GHasToDType dtype' dtype r r') => GHasToDType dtype' dtype (l :*: r) (l' :*: r') Source # 
Instance details

Defined in Torch.Typed.DType

Methods

gToDType :: (l :*: r) a -> (l' :*: r') a Source #

HasToDType dtype' dtype f g => GHasToDType dtype' dtype (K1 i f :: Type -> Type) (K1 i g :: Type -> Type) Source # 
Instance details

Defined in Torch.Typed.DType

Methods

gToDType :: K1 i f a -> K1 i g a Source #

GHasToDType dtype' dtype f g => GHasToDType dtype' dtype (M1 i t f) (M1 i t g) Source # 
Instance details

Defined in Torch.Typed.DType

Methods

gToDType :: M1 i t f a -> M1 i t g a Source #

type family GetDType (f :: k) :: Maybe DType where ... Source #

Equations

GetDType (t (dtype :: DType)) = Just dtype 
GetDType (t a) = GetDType t 
GetDType t = Nothing