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

Torch.Typed.Autograd

Synopsis

Documentation

class HasGrad a b | a -> b Source #

Minimal complete definition

grad, toDependent

Instances

Instances details
(HasGrad a b, HasGrad (HList as) (HList bs), Castable (HList (b ': bs)) [ATenTensor]) => HasGrad (HList (a ': as)) (HList (b ': bs)) Source # 
Instance details

Defined in Torch.Typed.Autograd

Methods

grad :: forall (dtype :: DType) (device :: (DeviceType, Nat)). Tensor device dtype '[] -> HList (a ': as) -> HList (b ': bs) Source #

toDependent :: HList (a ': as) -> HList (b ': bs)

HasGrad (HList ('[] :: [Type])) (HList ('[] :: [Type])) Source # 
Instance details

Defined in Torch.Typed.Autograd

Methods

grad :: forall (dtype :: DType) (device :: (DeviceType, Nat)). Tensor device dtype '[] -> HList '[] -> HList '[] Source #

toDependent :: HList '[] -> HList '[]

HasGrad (Parameter device dtype shape) (Tensor device dtype shape) Source # 
Instance details

Defined in Torch.Typed.Autograd

Methods

grad :: forall (dtype0 :: DType) (device0 :: (DeviceType, Nat)). Tensor device0 dtype0 '[] -> Parameter device dtype shape -> Tensor device dtype shape Source #

toDependent :: Parameter device dtype shape -> Tensor device dtype shape

grad :: forall dtype device. HasGrad a b => Tensor device dtype '[] -> a -> b Source #

calculate gradients of a zero-dimensional tensor with respect to a list of parameters