hasktorch-gradually-typed-0.2.0.0: experimental project for hasktorch
Safe HaskellSafe-Inferred
LanguageHaskell2010

Torch.GraduallyTyped.RequiresGradient

Synopsis

Documentation

data RequiresGradient Source #

Data type to represent whether or not the tensor requires gradient computations.

Constructors

WithGradient

The tensor requires gradient computations.

WithoutGradient

Gradient computations for this tensor are disabled.

Instances

Instances details
Show RequiresGradient Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

Eq RequiresGradient Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

SingKind RequiresGradient Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

Associated Types

type Demote RequiresGradient = (r :: Type) Source #

SingI 'WithGradient Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

SingI 'WithoutGradient Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

MkPosC device shape seqDim seqName seqSize output => HasForward MkAbsPos (Tensor gradient layout device dataType shape) generatorDevice (Tensor ('Gradient 'WithoutGradient) ('Layout 'Dense) device ('DataType 'Int64) ('Shape '['Dim ('Name "*") seqSize])) generatorDevice Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.Type

Methods

forward :: MonadThrow m => MkAbsPos -> Tensor gradient layout device dataType shape -> Generator generatorDevice -> m (Tensor ('Gradient 'WithoutGradient) ('Layout 'Dense) device ('DataType 'Int64) ('Shape '['Dim ('Name "*") seqSize]), Generator generatorDevice) Source #

KnownGradient ('UncheckedGradient :: Gradient RequiresGradient) Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

SGetGradient ('UncheckedGradient :: Gradient RequiresGradient) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetGradient :: forall (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (shape :: Shape [Dim (Name Symbol) (Size Nat)]). Tensor 'UncheckedGradient layout device dataType shape -> SGradient 'UncheckedGradient Source #

getRequiresGradient :: forall (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (shape :: Shape [Dim (Name Symbol) (Size Nat)]). Tensor 'UncheckedGradient layout device dataType shape -> RequiresGradient Source #

SingKind (Gradient RequiresGradient) Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

Associated Types

type Demote (Gradient RequiresGradient) = (r :: Type) Source #

SingI requiresGradient => SingI ('Gradient requiresGradient :: Gradient RequiresGradient) Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

Methods

sing :: Sing ('Gradient requiresGradient) Source #

MkRelPosC device shape seqDim seqName seqSize output => HasForward (MkRelPos relPosEncBucketDim) (Tensor gradient layout device dataType shape) generatorDevice (Tensor ('Gradient 'WithoutGradient) ('Layout 'Dense) device ('DataType 'Int64) ('Shape '['Dim ('Name "*") ('Size 1), 'Dim ('Name "*") seqSize, 'Dim ('Name "*") seqSize])) generatorDevice Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Transformer.Type

Methods

forward :: MonadThrow m => MkRelPos relPosEncBucketDim -> Tensor gradient layout device dataType shape -> Generator generatorDevice -> m (Tensor ('Gradient 'WithoutGradient) ('Layout 'Dense) device ('DataType 'Int64) ('Shape '['Dim ('Name "*") ('Size 1), 'Dim ('Name "*") seqSize, 'Dim ('Name "*") seqSize]), Generator generatorDevice) Source #

KnownRequiresGradient requiresGradient => KnownGradient ('Gradient requiresGradient) Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

SGetGradient ('Gradient 'WithGradient) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetGradient :: forall (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (shape :: Shape [Dim (Name Symbol) (Size Nat)]). Tensor ('Gradient 'WithGradient) layout device dataType shape -> SGradient ('Gradient 'WithGradient) Source #

getRequiresGradient :: forall (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (shape :: Shape [Dim (Name Symbol) (Size Nat)]). Tensor ('Gradient 'WithGradient) layout device dataType shape -> RequiresGradient Source #

SGetGradient ('Gradient 'WithoutGradient) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetGradient :: forall (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (shape :: Shape [Dim (Name Symbol) (Size Nat)]). Tensor ('Gradient 'WithoutGradient) layout device dataType shape -> SGradient ('Gradient 'WithoutGradient) Source #

getRequiresGradient :: forall (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (shape :: Shape [Dim (Name Symbol) (Size Nat)]). Tensor ('Gradient 'WithoutGradient) layout device dataType shape -> RequiresGradient Source #

HasGrad (Tensor ('Gradient 'WithGradient) layout device dataType shape) Source # 
Instance details

Defined in Torch.GraduallyTyped.Autograd

Associated Types

type Gradients (Tensor ('Gradient 'WithGradient) layout device dataType shape) Source #

type Loss (Tensor ('Gradient 'WithGradient) layout device dataType shape) Source #

Methods

grad :: Loss (Tensor ('Gradient 'WithGradient) layout device dataType shape) -> Tensor ('Gradient 'WithGradient) layout device dataType shape -> Gradients (Tensor ('Gradient 'WithGradient) layout device dataType shape) Source #

type Demote RequiresGradient Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

type Demote (Gradient RequiresGradient) Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

type Gradients (Tensor ('Gradient 'WithGradient) layout device dataType shape) Source # 
Instance details

Defined in Torch.GraduallyTyped.Autograd

type Gradients (Tensor ('Gradient 'WithGradient) layout device dataType shape) = Tensor ('Gradient 'WithoutGradient) layout device dataType shape
type Loss (Tensor ('Gradient 'WithGradient) layout device dataType shape) Source # 
Instance details

Defined in Torch.GraduallyTyped.Autograd

type Loss (Tensor ('Gradient 'WithGradient) layout device dataType shape) = Tensor ('Gradient 'WithoutGradient) layout device dataType shape

data SRequiresGradient :: RequiresGradient -> Type where Source #

Instances

Instances details
Show (SRequiresGradient requiresGradient) Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

Methods

showsPrec :: Int -> SRequiresGradient requiresGradient -> ShowS Source #

show :: SRequiresGradient requiresGradient -> String Source #

showList :: [SRequiresGradient requiresGradient] -> ShowS Source #

data Gradient (requiresGradient :: Type) where Source #

Data type to represent whether or not it is known by the compiler if the tensor requires gradient computations.

Constructors

UncheckedGradient :: forall requiresGradient. Gradient requiresGradient

Whether or not the tensor requires gradient computations is unknown to the compiler.

Gradient :: forall requiresGradient. requiresGradient -> Gradient requiresGradient

Whether or not the tensor requires gradient computations is known to the compiler.

Instances

Instances details
Show requiresGradient => Show (Gradient requiresGradient) Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

Methods

showsPrec :: Int -> Gradient requiresGradient -> ShowS Source #

show :: Gradient requiresGradient -> String Source #

showList :: [Gradient requiresGradient] -> ShowS Source #

SingKind (Gradient RequiresGradient) Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

Associated Types

type Demote (Gradient RequiresGradient) = (r :: Type) Source #

SingI requiresGradient => SingI ('Gradient requiresGradient :: Gradient RequiresGradient) Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

Methods

sing :: Sing ('Gradient requiresGradient) Source #

type Demote (Gradient RequiresGradient) Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

data SGradient (gradient :: Gradient RequiresGradient) where Source #

Constructors

SUncheckedGradient :: RequiresGradient -> SGradient 'UncheckedGradient 
SGradient :: forall requiresGradient. SRequiresGradient requiresGradient -> SGradient ('Gradient requiresGradient) 

Instances

Instances details
Show (SGradient requiresGradient) Source # 
Instance details

Defined in Torch.GraduallyTyped.RequiresGradient

Methods

showsPrec :: Int -> SGradient requiresGradient -> ShowS Source #

show :: SGradient requiresGradient -> String Source #

showList :: [SGradient requiresGradient] -> ShowS Source #

type family GetGradients f where ... Source #