Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Size (size :: Type) where
- UncheckedSize :: forall size. Size size
- Size :: forall size. size -> Size size
- data SSize (size :: Size Nat) where
- SUncheckedSize :: Integer -> SSize 'UncheckedSize
- SSize :: forall size. KnownNat size => SSize ('Size size)
- type family SizeF (size :: Size Nat) :: Nat where ...
- class KnownSize (size :: Size Nat) where
- data Name (name :: Type) where
- UncheckedName :: forall name. Name name
- Name :: forall name. name -> Name name
- data SName (name :: Name Symbol) where
- SUncheckedName :: String -> SName 'UncheckedName
- SName :: forall name. KnownSymbol name => SName ('Name name)
- pattern SNoName :: SName ('Name "*")
- type family NameF (name :: Name Symbol) :: Symbol where ...
- class KnownName (name :: Name Symbol) where
- data Dim (name :: Type) (size :: Type) where
- data SDim (dim :: Dim (Name Symbol) (Size Nat)) where
- pattern (:&:) :: forall (name :: Name Symbol) (size :: Size Nat). SName name -> SSize size -> SDim ('Dim name size)
- class KnownDim (dim :: Dim (Name Symbol) (Size Nat)) where
- data By (name :: Type) (index :: Type) where
- data SBy (by :: By Symbol Nat) where
- type family ByNameF (by :: By Symbol Nat) :: Symbol where ...
- type family ByIndexF (by :: By Symbol Nat) :: Nat where ...
- class KnownBy (by :: By Symbol Nat) where
- data SelectDim (by :: Type) where
- UncheckedSelectDim :: forall by. SelectDim by
- SelectDim :: forall by. by -> SelectDim by
- data SSelectDim (selectDim :: SelectDim (By Symbol Nat)) where
- SUncheckedSelectDim :: By String Integer -> SSelectDim 'UncheckedSelectDim
- SSelectDim :: forall by. SBy by -> SSelectDim ('SelectDim by)
- class KnownSelectDim (selectDim :: SelectDim (By Symbol Nat)) where
- selectDimVal :: SelectDim (By String Integer)
- data SelectDims (selectDims :: Type) where
- UncheckedSelectDims :: forall selectDims. SelectDims selectDims
- SelectDims :: forall selectDims. selectDims -> SelectDims selectDims
- data SSelectDims (selectDims :: SelectDims [By Symbol Nat]) where
- SUncheckedSelectDims :: [By String Integer] -> SSelectDims 'UncheckedSelectDims
- SSelectDims :: forall bys. SList bys -> SSelectDims ('SelectDims bys)
- class KnownSelectDims (selectDims :: SelectDims [By Symbol Nat]) where
- data Shape (dims :: Type) where
- UncheckedShape :: forall dims. Shape dims
- Shape :: forall dims. dims -> Shape dims
- data SShape (shape :: Shape [Dim (Name Symbol) (Size Nat)]) where
- SUncheckedShape :: [Dim String Integer] -> SShape 'UncheckedShape
- SShape :: forall dims. SList dims -> SShape ('Shape dims)
- class KnownShape (shape :: Shape [Dim (Name Symbol) (Size Nat)]) where
- type family GetShapes f where ...
Documentation
data Size (size :: Type) where Source #
UncheckedSize :: forall size. Size size | |
Size :: forall size. size -> Size size |
Instances
TensorLike Bool 'Bool ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sToTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) m. MonadThrow m => SGradient gradient -> SLayout layout -> SDevice device -> Bool0 -> m (Tensor gradient layout device ('DataType 'Bool) ('Shape '[])) Source # fromTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)). Tensor gradient layout device ('DataType 'Bool) ('Shape '[]) -> Bool0 Source # | |
TensorLike Double 'Double ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sToTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) m. MonadThrow m => SGradient gradient -> SLayout layout -> SDevice device -> Double0 -> m (Tensor gradient layout device ('DataType 'Double) ('Shape '[])) Source # fromTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)). Tensor gradient layout device ('DataType 'Double) ('Shape '[]) -> Double0 Source # | |
TensorLike Float 'Float ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sToTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) m. MonadThrow m => SGradient gradient -> SLayout layout -> SDevice device -> Float0 -> m (Tensor gradient layout device ('DataType 'Float) ('Shape '[])) Source # fromTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)). Tensor gradient layout device ('DataType 'Float) ('Shape '[]) -> Float0 Source # | |
TensorLike Int 'Int64 ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sToTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) m. MonadThrow m => SGradient gradient -> SLayout layout -> SDevice device -> Int -> m (Tensor gradient layout device ('DataType 'Int64) ('Shape '[])) Source # fromTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)). Tensor gradient layout device ('DataType 'Int64) ('Shape '[]) -> Int Source # | |
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 # | |
Defined in Torch.GraduallyTyped.NN.Transformer.Type | |
Show size => Show (Size size) Source # | |
KnownShape ('UncheckedShape :: Shape [Dim (Name Symbol) (Size Nat)]) Source # | |
SGetDims ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # | |
SGetShape ('UncheckedShape :: Shape [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sGetShape :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType). Tensor gradient layout device dataType 'UncheckedShape -> SShape 'UncheckedShape Source # getDims :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType). Tensor gradient layout device dataType 'UncheckedShape -> [Dim String Integer] Source # | |
SingKind (Shape [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
SingKind (Size Nat) Source # | |
SingI dims => SingI ('Shape dims :: Shape [Dim (Name Symbol) (Size Nat)]) Source # | |
KnownNat size => SingI ('Size size :: Size Nat) 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 # | |
Defined in Torch.GraduallyTyped.NN.Transformer.Type 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 # | |
(KnownShape ('Shape dims), KnownDim dim) => KnownShape ('Shape (dim ': dims)) Source # | |
KnownShape ('Shape ('[] :: [Dim (Name Symbol) (Size Nat)])) Source # | |
SGetDims dims => SGetShape ('Shape dims) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sGetShape :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType). Tensor gradient layout device dataType ('Shape dims) -> SShape ('Shape dims) Source # getDims :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType). Tensor gradient layout device dataType ('Shape dims) -> [Dim String Integer] Source # | |
SingKind (Dim (Name Symbol) (Size Nat)) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
(output ~ GLinear (Tensor gradient ('Layout 'Dense) (device <+> generatorDevice) dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) (device <+> generatorDevice) dataType ('Shape '[outputDim])), generatorOutputDevice ~ (device <+> generatorDevice), SGetGeneratorDevice generatorDevice, SGetGeneratorDevice generatorOutputDevice) => HasInitialize (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim]))) generatorDevice output generatorOutputDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Linear | |
(output ~ GLinear (Tensor gradient ('Layout 'Dense) (device <+> generatorDevice) dataType ('Shape '[outputDim, inputDim])) (), generatorOutputDevice ~ (device <+> generatorDevice), SGetGeneratorDevice generatorDevice) => HasInitialize (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) ()) generatorDevice output generatorOutputDevice Source # | TODO: Add |
Defined in Torch.GraduallyTyped.NN.Linear | |
(KnownSymbol name, KnownNat size) => SingI ('Dim ('Name name) ('Size size) :: Dim (Name Symbol) (Size Nat)) Source # | |
output ~ Tensor (gradient <|> gradient') ('Layout 'Dense <+> layout') (device <+> device') (dataType <+> dataType') (LinearWithBiasF ('Shape '[outputDim, inputDim]) ('Shape '[outputDim]) shape') => HasForward (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim]))) (Tensor gradient' layout' device' dataType' shape') generatorDevice output generatorDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Linear forward :: MonadThrow m => GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim])) -> Tensor gradient' layout' device' dataType' shape' -> Generator generatorDevice -> m (output, Generator generatorDevice) Source # | |
output ~ Tensor (gradient <|> gradient') ('Layout 'Dense <+> layout') (device <+> device') (dataType <+> dataType') (LinearWithoutBiasF ('Shape '[outputDim, inputDim]) shape') => HasForward (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) ()) (Tensor gradient' layout' device' dataType' shape') generatorDevice output generatorDevice Source # | |
(SGetDim dim, SGetDims dims) => SGetDims (dim ': dims) Source # | |
(KnownName name, KnownSize size) => KnownDim ('Dim name size) Source # | |
(KnownSymbol name, KnownNat size) => SGetDim ('Dim ('Name name) ('Size size)) Source # | |
KnownSymbol name => SGetDim ('Dim ('Name name) ('UncheckedSize :: Size Nat)) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type | |
KnownNat size => SGetDim ('Dim ('UncheckedName :: Name Symbol) ('Size size)) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type | |
SGetDim ('Dim ('UncheckedName :: Name Symbol) ('UncheckedSize :: Size Nat)) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sGetDim :: String -> Integer -> SDim ('Dim 'UncheckedName 'UncheckedSize) Source # | |
type Demote (Shape [Dim (Name Symbol) (Size Nat)]) Source # | |
type Demote (Size Nat) Source # | |
type Sing Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
type Sing Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
type Demote (Dim (Name Symbol) (Size Nat)) Source # | |
type Sing Source # | |
Defined in Torch.GraduallyTyped.Shape.Type |
data SSize (size :: Size Nat) where Source #
SUncheckedSize :: Integer -> SSize 'UncheckedSize | |
SSize :: forall size. KnownNat size => SSize ('Size size) |
data Name (name :: Type) where Source #
UncheckedName :: forall name. Name name | |
Name :: forall name. name -> Name name |
Instances
TensorLike Bool 'Bool ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sToTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) m. MonadThrow m => SGradient gradient -> SLayout layout -> SDevice device -> Bool0 -> m (Tensor gradient layout device ('DataType 'Bool) ('Shape '[])) Source # fromTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)). Tensor gradient layout device ('DataType 'Bool) ('Shape '[]) -> Bool0 Source # | |
TensorLike Double 'Double ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sToTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) m. MonadThrow m => SGradient gradient -> SLayout layout -> SDevice device -> Double0 -> m (Tensor gradient layout device ('DataType 'Double) ('Shape '[])) Source # fromTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)). Tensor gradient layout device ('DataType 'Double) ('Shape '[]) -> Double0 Source # | |
TensorLike Float 'Float ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sToTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) m. MonadThrow m => SGradient gradient -> SLayout layout -> SDevice device -> Float0 -> m (Tensor gradient layout device ('DataType 'Float) ('Shape '[])) Source # fromTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)). Tensor gradient layout device ('DataType 'Float) ('Shape '[]) -> Float0 Source # | |
TensorLike Int 'Int64 ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sToTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) m. MonadThrow m => SGradient gradient -> SLayout layout -> SDevice device -> Int -> m (Tensor gradient layout device ('DataType 'Int64) ('Shape '[])) Source # fromTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)). Tensor gradient layout device ('DataType 'Int64) ('Shape '[]) -> Int Source # | |
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 # | |
Defined in Torch.GraduallyTyped.NN.Transformer.Type | |
Show name => Show (Name name) Source # | |
KnownShape ('UncheckedShape :: Shape [Dim (Name Symbol) (Size Nat)]) Source # | |
SGetDims ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # | |
SGetShape ('UncheckedShape :: Shape [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sGetShape :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType). Tensor gradient layout device dataType 'UncheckedShape -> SShape 'UncheckedShape Source # getDims :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType). Tensor gradient layout device dataType 'UncheckedShape -> [Dim String Integer] Source # | |
SingKind (Name Symbol) Source # | |
SingKind (Shape [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
KnownSymbol name => SingI ('Name name :: Name Symbol) Source # | |
SingI dims => SingI ('Shape dims :: Shape [Dim (Name Symbol) (Size Nat)]) 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 # | |
Defined in Torch.GraduallyTyped.NN.Transformer.Type 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 # | |
(KnownShape ('Shape dims), KnownDim dim) => KnownShape ('Shape (dim ': dims)) Source # | |
KnownShape ('Shape ('[] :: [Dim (Name Symbol) (Size Nat)])) Source # | |
SGetDims dims => SGetShape ('Shape dims) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sGetShape :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType). Tensor gradient layout device dataType ('Shape dims) -> SShape ('Shape dims) Source # getDims :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType). Tensor gradient layout device dataType ('Shape dims) -> [Dim String Integer] Source # | |
SingKind (Dim (Name Symbol) (Size Nat)) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
(output ~ GLinear (Tensor gradient ('Layout 'Dense) (device <+> generatorDevice) dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) (device <+> generatorDevice) dataType ('Shape '[outputDim])), generatorOutputDevice ~ (device <+> generatorDevice), SGetGeneratorDevice generatorDevice, SGetGeneratorDevice generatorOutputDevice) => HasInitialize (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim]))) generatorDevice output generatorOutputDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Linear | |
(output ~ GLinear (Tensor gradient ('Layout 'Dense) (device <+> generatorDevice) dataType ('Shape '[outputDim, inputDim])) (), generatorOutputDevice ~ (device <+> generatorDevice), SGetGeneratorDevice generatorDevice) => HasInitialize (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) ()) generatorDevice output generatorOutputDevice Source # | TODO: Add |
Defined in Torch.GraduallyTyped.NN.Linear | |
(KnownSymbol name, KnownNat size) => SingI ('Dim ('Name name) ('Size size) :: Dim (Name Symbol) (Size Nat)) Source # | |
output ~ Tensor (gradient <|> gradient') ('Layout 'Dense <+> layout') (device <+> device') (dataType <+> dataType') (LinearWithBiasF ('Shape '[outputDim, inputDim]) ('Shape '[outputDim]) shape') => HasForward (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim]))) (Tensor gradient' layout' device' dataType' shape') generatorDevice output generatorDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Linear forward :: MonadThrow m => GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim])) -> Tensor gradient' layout' device' dataType' shape' -> Generator generatorDevice -> m (output, Generator generatorDevice) Source # | |
output ~ Tensor (gradient <|> gradient') ('Layout 'Dense <+> layout') (device <+> device') (dataType <+> dataType') (LinearWithoutBiasF ('Shape '[outputDim, inputDim]) shape') => HasForward (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) ()) (Tensor gradient' layout' device' dataType' shape') generatorDevice output generatorDevice Source # | |
(SGetDim dim, SGetDims dims) => SGetDims (dim ': dims) Source # | |
(KnownName name, KnownSize size) => KnownDim ('Dim name size) Source # | |
(KnownSymbol name, KnownNat size) => SGetDim ('Dim ('Name name) ('Size size)) Source # | |
KnownSymbol name => SGetDim ('Dim ('Name name) ('UncheckedSize :: Size Nat)) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type | |
KnownNat size => SGetDim ('Dim ('UncheckedName :: Name Symbol) ('Size size)) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type | |
SGetDim ('Dim ('UncheckedName :: Name Symbol) ('UncheckedSize :: Size Nat)) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sGetDim :: String -> Integer -> SDim ('Dim 'UncheckedName 'UncheckedSize) Source # | |
type Demote (Name Symbol) Source # | |
type Demote (Shape [Dim (Name Symbol) (Size Nat)]) Source # | |
type Sing Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
type Sing Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
type Demote (Dim (Name Symbol) (Size Nat)) Source # | |
type Sing Source # | |
Defined in Torch.GraduallyTyped.Shape.Type |
data SName (name :: Name Symbol) where Source #
SUncheckedName :: String -> SName 'UncheckedName | |
SName :: forall name. KnownSymbol name => SName ('Name name) |
data Dim (name :: Type) (size :: Type) where Source #
Instances
Bifunctor Dim Source # | |
TensorLike Bool 'Bool ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sToTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) m. MonadThrow m => SGradient gradient -> SLayout layout -> SDevice device -> Bool0 -> m (Tensor gradient layout device ('DataType 'Bool) ('Shape '[])) Source # fromTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)). Tensor gradient layout device ('DataType 'Bool) ('Shape '[]) -> Bool0 Source # | |
TensorLike Double 'Double ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sToTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) m. MonadThrow m => SGradient gradient -> SLayout layout -> SDevice device -> Double0 -> m (Tensor gradient layout device ('DataType 'Double) ('Shape '[])) Source # fromTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)). Tensor gradient layout device ('DataType 'Double) ('Shape '[]) -> Double0 Source # | |
TensorLike Float 'Float ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sToTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) m. MonadThrow m => SGradient gradient -> SLayout layout -> SDevice device -> Float0 -> m (Tensor gradient layout device ('DataType 'Float) ('Shape '[])) Source # fromTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)). Tensor gradient layout device ('DataType 'Float) ('Shape '[]) -> Float0 Source # | |
TensorLike Int 'Int64 ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sToTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) m. MonadThrow m => SGradient gradient -> SLayout layout -> SDevice device -> Int -> m (Tensor gradient layout device ('DataType 'Int64) ('Shape '[])) Source # fromTensor :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)). Tensor gradient layout device ('DataType 'Int64) ('Shape '[]) -> Int Source # | |
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 # | |
Defined in Torch.GraduallyTyped.NN.Transformer.Type | |
KnownShape ('UncheckedShape :: Shape [Dim (Name Symbol) (Size Nat)]) Source # | |
SGetDims ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # | |
SGetShape ('UncheckedShape :: Shape [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sGetShape :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType). Tensor gradient layout device dataType 'UncheckedShape -> SShape 'UncheckedShape Source # getDims :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType). Tensor gradient layout device dataType 'UncheckedShape -> [Dim String Integer] Source # | |
SingKind (Shape [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
SingI dims => SingI ('Shape dims :: Shape [Dim (Name Symbol) (Size Nat)]) 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 # | |
Defined in Torch.GraduallyTyped.NN.Transformer.Type 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 # | |
(Show name, Show size) => Show (Dim name size) Source # | |
(Eq name, Eq size) => Eq (Dim name size) Source # | |
(Ord name, Ord size) => Ord (Dim name size) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type compare :: Dim name size -> Dim name size -> Ordering Source # (<) :: Dim name size -> Dim name size -> Bool Source # (<=) :: Dim name size -> Dim name size -> Bool Source # (>) :: Dim name size -> Dim name size -> Bool Source # (>=) :: Dim name size -> Dim name size -> Bool Source # max :: Dim name size -> Dim name size -> Dim name size Source # min :: Dim name size -> Dim name size -> Dim name size Source # | |
(KnownShape ('Shape dims), KnownDim dim) => KnownShape ('Shape (dim ': dims)) Source # | |
KnownShape ('Shape ('[] :: [Dim (Name Symbol) (Size Nat)])) Source # | |
SGetDims dims => SGetShape ('Shape dims) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Type sGetShape :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType). Tensor gradient layout device dataType ('Shape dims) -> SShape ('Shape dims) Source # getDims :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType). Tensor gradient layout device dataType ('Shape dims) -> [Dim String Integer] Source # | |
SingKind (Dim (Name Symbol) (Size Nat)) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
(output ~ GLinear (Tensor gradient ('Layout 'Dense) (device <+> generatorDevice) dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) (device <+> generatorDevice) dataType ('Shape '[outputDim])), generatorOutputDevice ~ (device <+> generatorDevice), SGetGeneratorDevice generatorDevice, SGetGeneratorDevice generatorOutputDevice) => HasInitialize (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim]))) generatorDevice output generatorOutputDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Linear | |
(output ~ GLinear (Tensor gradient ('Layout 'Dense) (device <+> generatorDevice) dataType ('Shape '[outputDim, inputDim])) (), generatorOutputDevice ~ (device <+> generatorDevice), SGetGeneratorDevice generatorDevice) => HasInitialize (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) ()) generatorDevice output generatorOutputDevice Source # | TODO: Add |
Defined in Torch.GraduallyTyped.NN.Linear | |
(KnownSymbol name, KnownNat size) => SingI ('Dim ('Name name) ('Size size) :: Dim (Name Symbol) (Size Nat)) Source # | |
output ~ Tensor (gradient <|> gradient') ('Layout 'Dense <+> layout') (device <+> device') (dataType <+> dataType') (LinearWithBiasF ('Shape '[outputDim, inputDim]) ('Shape '[outputDim]) shape') => HasForward (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim]))) (Tensor gradient' layout' device' dataType' shape') generatorDevice output generatorDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Linear forward :: MonadThrow m => GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim])) -> Tensor gradient' layout' device' dataType' shape' -> Generator generatorDevice -> m (output, Generator generatorDevice) Source # | |
output ~ Tensor (gradient <|> gradient') ('Layout 'Dense <+> layout') (device <+> device') (dataType <+> dataType') (LinearWithoutBiasF ('Shape '[outputDim, inputDim]) shape') => HasForward (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) ()) (Tensor gradient' layout' device' dataType' shape') generatorDevice output generatorDevice Source # | |
(SGetDim dim, SGetDims dims) => SGetDims (dim ': dims) Source # | |
type Demote (Shape [Dim (Name Symbol) (Size Nat)]) Source # | |
type Sing Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
type Demote (Dim (Name Symbol) (Size Nat)) Source # | |
type Sing Source # | |
Defined in Torch.GraduallyTyped.Shape.Type |
data SDim (dim :: Dim (Name Symbol) (Size Nat)) where Source #
Instances
Show (SDim dim) Source # | |
HasStateDict (SDim dim) Source # | |
Defined in Torch.GraduallyTyped.NN.Class fromStateDict :: (MonadIO m, MonadThrow m, MonadState StateDict m) => ModelSpec (SDim dim) -> StateDictKey -> m (SDim dim) Source # toStateDict :: (MonadThrow m, MonadState StateDict m) => StateDictKey -> SDim dim -> m () Source # | |
HasInitialize (SDim dim) generatorDevice (SDim dim) generatorDevice Source # | |
Defined in Torch.GraduallyTyped.NN.Class initialize :: MonadThrow m => ModelSpec (SDim dim) -> Generator generatorDevice -> m (SDim dim, Generator generatorDevice) Source # | |
type ModelSpec (SDim dim) Source # | |
Defined in Torch.GraduallyTyped.NN.Class |
pattern (:&:) :: forall (name :: Name Symbol) (size :: Size Nat). SName name -> SSize size -> SDim ('Dim name size) infix 9 Source #
data By (name :: Type) (index :: Type) where Source #
Data type to select dimensions by name or by index.
ByName :: forall name index. name -> By name index | Select a dimension by name. |
ByIndex :: forall name index. index -> By name index | Select a dimension by index. Counting starts at zero for the first dimension. |
Instances
data SelectDim (by :: Type) where Source #
UncheckedSelectDim :: forall by. SelectDim by | Unknown method of dimension selection. |
SelectDim :: forall by. by -> SelectDim by | Known method of dimension selection, that is, either by name or by index. |
data SSelectDim (selectDim :: SelectDim (By Symbol Nat)) where Source #
SUncheckedSelectDim :: By String Integer -> SSelectDim 'UncheckedSelectDim | |
SSelectDim :: forall by. SBy by -> SSelectDim ('SelectDim by) |
Instances
Show (SSelectDim selectDim) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type |
class KnownSelectDim (selectDim :: SelectDim (By Symbol Nat)) where Source #
Instances
KnownSelectDim ('UncheckedSelectDim :: SelectDim (By Symbol Nat)) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
KnownBy by => KnownSelectDim ('SelectDim by) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type selectDimVal :: SelectDim0 (By String Integer) Source # |
data SelectDims (selectDims :: Type) where Source #
UncheckedSelectDims :: forall selectDims. SelectDims selectDims | |
SelectDims :: forall selectDims. selectDims -> SelectDims selectDims |
Instances
SingKind (SelectDims [By Symbol Nat]) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
SingI bys => SingI ('SelectDims bys :: SelectDims [By Symbol Nat]) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type sing :: Sing ('SelectDims bys) Source # | |
type Demote (SelectDims [By Symbol Nat]) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
type Sing Source # | |
Defined in Torch.GraduallyTyped.Shape.Type |
data SSelectDims (selectDims :: SelectDims [By Symbol Nat]) where Source #
SUncheckedSelectDims :: [By String Integer] -> SSelectDims 'UncheckedSelectDims | |
SSelectDims :: forall bys. SList bys -> SSelectDims ('SelectDims bys) |
Instances
Show (SSelectDims selectDims) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type |
class KnownSelectDims (selectDims :: SelectDims [By Symbol Nat]) where Source #
Instances
KnownSelectDims ('UncheckedSelectDims :: SelectDims [By Symbol Nat]) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
(KnownBy by, KnownSelectDims ('SelectDims bys)) => KnownSelectDims ('SelectDims (by ': bys)) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
KnownSelectDims ('SelectDims ('[] :: [By Symbol Nat])) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type |
data Shape (dims :: Type) where Source #
Data type to represent tensor shapes, that is, lists of dimensions.
UncheckedShape :: forall dims. Shape dims | The shape is fully unchecked. Neither the number of the dimensions nor any dimension properties are known to the compiler. |
Shape :: forall dims. dims -> Shape dims | The shape is partially known to the compiler.
The list of dimensions has a known length, but may contain |
Instances
Show dims => Show (Shape dims) Source # | |
SingKind (Shape [Dim (Name Symbol) (Size Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Shape.Type | |
SingI dims => SingI ('Shape dims :: Shape [Dim (Name Symbol) (Size Nat)]) Source # | |
type Demote (Shape [Dim (Name Symbol) (Size Nat)]) Source # | |
type Sing Source # | |
Defined in Torch.GraduallyTyped.Shape.Type |
data SShape (shape :: Shape [Dim (Name Symbol) (Size Nat)]) where Source #
SUncheckedShape :: [Dim String Integer] -> SShape 'UncheckedShape | |
SShape :: forall dims. SList dims -> SShape ('Shape dims) |
class KnownShape (shape :: Shape [Dim (Name Symbol) (Size Nat)]) where Source #
Orphan instances
Castable String (ForeignPtr Dimname) Source # | |
Castable [ForeignPtr Dimname] (ForeignPtr DimnameList) Source # | |
cast :: [ForeignPtr Dimname] -> (ForeignPtr DimnameList -> IO r) -> IO r Source # uncast :: ForeignPtr DimnameList -> ([ForeignPtr Dimname] -> IO r) -> IO r Source # | |
Castable [String] (ForeignPtr DimnameList) Source # | |
cast :: [String] -> (ForeignPtr DimnameList -> IO r) -> IO r Source # uncast :: ForeignPtr DimnameList -> ([String] -> IO r) -> IO r Source # | |
Castable [Integer] (ForeignPtr IntArray) Source # | |