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

Torch.GraduallyTyped.Shape.Type

Synopsis

Documentation

data Size (size :: Type) where Source #

Constructors

UncheckedSize :: forall size. Size size 
Size :: forall size. size -> Size size 

Instances

Instances details
TensorLike Bool 'Bool ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
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 #

Show size => Show (Size size) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

showsPrec :: Int -> Size size -> ShowS Source #

show :: Size size -> String Source #

showList :: [Size size] -> ShowS Source #

KnownShape ('UncheckedShape :: Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

SGetDims ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetDims :: [String] -> [Integer] -> SList '[] Source #

SGetShape ('UncheckedShape :: Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Associated Types

type Demote (Shape [Dim (Name Symbol) (Size Nat)]) = (r :: Type) Source #

SingKind (Size Nat) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Associated Types

type Demote (Size Nat) = (r :: Type) Source #

Methods

fromSing :: forall (a :: Size Nat). Sing a -> Demote (Size Nat) Source #

toSing :: Demote (Size Nat) -> SomeSing (Size Nat) Source #

SingI dims => SingI ('Shape dims :: Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

sing :: Sing ('Shape dims) Source #

KnownNat size => SingI ('Size size :: Size Nat) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

sing :: Sing ('Size size) 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 #

(KnownShape ('Shape dims), KnownDim dim) => KnownShape ('Shape (dim ': dims)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

KnownShape ('Shape ('[] :: [Dim (Name Symbol) (Size Nat)])) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

SGetDims dims => SGetShape ('Shape dims) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Associated Types

type Demote (Dim (Name Symbol) (Size Nat)) = (r :: Type) Source #

(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 # 
Instance details

Defined in Torch.GraduallyTyped.NN.Linear

Methods

initialize :: MonadThrow m => ModelSpec (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim]))) -> Generator generatorDevice -> m (output, Generator generatorOutputDevice) Source #

(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 ForNonLinearity as parameter.

Instance details

Defined in Torch.GraduallyTyped.NN.Linear

Methods

initialize :: MonadThrow m => ModelSpec (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) ()) -> Generator generatorDevice -> m (output, Generator generatorOutputDevice) Source #

(KnownSymbol name, KnownNat size) => SingI ('Dim ('Name name) ('Size size) :: Dim (Name Symbol) (Size Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

sing :: Sing ('Dim ('Name name) ('Size size)) 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 # 
Instance details

Defined in Torch.GraduallyTyped.NN.Linear

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.NN.Linear

Methods

forward :: MonadThrow m => GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) () -> Tensor gradient' layout' device' dataType' shape' -> Generator generatorDevice -> m (output, Generator generatorDevice) Source #

(SGetDim dim, SGetDims dims) => SGetDims (dim ': dims) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetDims :: [String] -> [Integer] -> SList (dim ': dims) Source #

(KnownName name, KnownSize size) => KnownDim ('Dim name size) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

(KnownSymbol name, KnownNat size) => SGetDim ('Dim ('Name name) ('Size size)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetDim :: String -> Integer -> SDim ('Dim ('Name name) ('Size size)) Source #

KnownSymbol name => SGetDim ('Dim ('Name name) ('UncheckedSize :: Size Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetDim :: String -> Integer -> SDim ('Dim ('Name name) 'UncheckedSize) Source #

KnownNat size => SGetDim ('Dim ('UncheckedName :: Name Symbol) ('Size size)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetDim :: String -> Integer -> SDim ('Dim 'UncheckedName ('Size size)) Source #

SGetDim ('Dim ('UncheckedName :: Name Symbol) ('UncheckedSize :: Size Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

type Demote (Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Demote (Size Nat) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing = SShape
type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing = SSize
type Demote (Dim (Name Symbol) (Size Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing = SDim

data SSize (size :: Size Nat) where Source #

Constructors

SUncheckedSize :: Integer -> SSize 'UncheckedSize 
SSize :: forall size. KnownNat size => SSize ('Size size) 

Instances

Instances details
Show (SSize size) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

showsPrec :: Int -> SSize size -> ShowS Source #

show :: SSize size -> String Source #

showList :: [SSize size] -> ShowS Source #

type family SizeF (size :: Size Nat) :: Nat where ... Source #

Equations

SizeF ('Size size) = size 

class KnownSize (size :: Size Nat) where Source #

Instances

Instances details
KnownSize ('UncheckedSize :: Size Nat) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

KnownNat size => KnownSize ('Size size) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

data Name (name :: Type) where Source #

Constructors

UncheckedName :: forall name. Name name 
Name :: forall name. name -> Name name 

Instances

Instances details
TensorLike Bool 'Bool ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
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 #

Show name => Show (Name name) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

showsPrec :: Int -> Name name -> ShowS Source #

show :: Name name -> String Source #

showList :: [Name name] -> ShowS Source #

KnownShape ('UncheckedShape :: Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

SGetDims ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetDims :: [String] -> [Integer] -> SList '[] Source #

SGetShape ('UncheckedShape :: Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Associated Types

type Demote (Name Symbol) = (r :: Type) Source #

SingKind (Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Associated Types

type Demote (Shape [Dim (Name Symbol) (Size Nat)]) = (r :: Type) Source #

KnownSymbol name => SingI ('Name name :: Name Symbol) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

sing :: Sing ('Name name) Source #

SingI dims => SingI ('Shape dims :: Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

sing :: Sing ('Shape dims) 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 #

(KnownShape ('Shape dims), KnownDim dim) => KnownShape ('Shape (dim ': dims)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

KnownShape ('Shape ('[] :: [Dim (Name Symbol) (Size Nat)])) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

SGetDims dims => SGetShape ('Shape dims) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Associated Types

type Demote (Dim (Name Symbol) (Size Nat)) = (r :: Type) Source #

(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 # 
Instance details

Defined in Torch.GraduallyTyped.NN.Linear

Methods

initialize :: MonadThrow m => ModelSpec (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim]))) -> Generator generatorDevice -> m (output, Generator generatorOutputDevice) Source #

(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 ForNonLinearity as parameter.

Instance details

Defined in Torch.GraduallyTyped.NN.Linear

Methods

initialize :: MonadThrow m => ModelSpec (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) ()) -> Generator generatorDevice -> m (output, Generator generatorOutputDevice) Source #

(KnownSymbol name, KnownNat size) => SingI ('Dim ('Name name) ('Size size) :: Dim (Name Symbol) (Size Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

sing :: Sing ('Dim ('Name name) ('Size size)) 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 # 
Instance details

Defined in Torch.GraduallyTyped.NN.Linear

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.NN.Linear

Methods

forward :: MonadThrow m => GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) () -> Tensor gradient' layout' device' dataType' shape' -> Generator generatorDevice -> m (output, Generator generatorDevice) Source #

(SGetDim dim, SGetDims dims) => SGetDims (dim ': dims) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetDims :: [String] -> [Integer] -> SList (dim ': dims) Source #

(KnownName name, KnownSize size) => KnownDim ('Dim name size) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

(KnownSymbol name, KnownNat size) => SGetDim ('Dim ('Name name) ('Size size)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetDim :: String -> Integer -> SDim ('Dim ('Name name) ('Size size)) Source #

KnownSymbol name => SGetDim ('Dim ('Name name) ('UncheckedSize :: Size Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetDim :: String -> Integer -> SDim ('Dim ('Name name) 'UncheckedSize) Source #

KnownNat size => SGetDim ('Dim ('UncheckedName :: Name Symbol) ('Size size)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetDim :: String -> Integer -> SDim ('Dim 'UncheckedName ('Size size)) Source #

SGetDim ('Dim ('UncheckedName :: Name Symbol) ('UncheckedSize :: Size Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

type Demote (Name Symbol) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Demote (Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing = SName
type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing = SShape
type Demote (Dim (Name Symbol) (Size Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing = SDim

data SName (name :: Name Symbol) where Source #

Constructors

SUncheckedName :: String -> SName 'UncheckedName 
SName :: forall name. KnownSymbol name => SName ('Name name) 

Instances

Instances details
Show (SName name) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

showsPrec :: Int -> SName name -> ShowS Source #

show :: SName name -> String Source #

showList :: [SName name] -> ShowS Source #

pattern SNoName :: SName ('Name "*") Source #

type family NameF (name :: Name Symbol) :: Symbol where ... Source #

Equations

NameF ('Name name) = name 

class KnownName (name :: Name Symbol) where Source #

Instances

Instances details
KnownName ('UncheckedName :: Name Symbol) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

KnownSymbol name => KnownName ('Name name) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

data Dim (name :: Type) (size :: Type) where Source #

Constructors

Dim 

Fields

  • :: forall name size. { dimName :: name
     
  •    , dimSize :: size
     
  •    } -> Dim name size
     

Instances

Instances details
Bifunctor Dim Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

bimap :: (a -> b) -> (c -> d) -> Dim a c -> Dim b d Source #

first :: (a -> b) -> Dim a c -> Dim b c Source #

second :: (b -> c) -> Dim a b -> Dim a c Source #

TensorLike Bool 'Bool ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
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 #

KnownShape ('UncheckedShape :: Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

SGetDims ('[] :: [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetDims :: [String] -> [Integer] -> SList '[] Source #

SGetShape ('UncheckedShape :: Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Associated Types

type Demote (Shape [Dim (Name Symbol) (Size Nat)]) = (r :: Type) Source #

SingI dims => SingI ('Shape dims :: Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

sing :: Sing ('Shape dims) 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 #

(Show name, Show size) => Show (Dim name size) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

showsPrec :: Int -> Dim name size -> ShowS Source #

show :: Dim name size -> String Source #

showList :: [Dim name size] -> ShowS Source #

(Eq name, Eq size) => Eq (Dim name size) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

(==) :: Dim name size -> Dim name size -> Bool Source #

(/=) :: Dim name size -> Dim name size -> Bool Source #

(Ord name, Ord size) => Ord (Dim name size) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

KnownShape ('Shape ('[] :: [Dim (Name Symbol) (Size Nat)])) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

SGetDims dims => SGetShape ('Shape dims) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Associated Types

type Demote (Dim (Name Symbol) (Size Nat)) = (r :: Type) Source #

(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 # 
Instance details

Defined in Torch.GraduallyTyped.NN.Linear

Methods

initialize :: MonadThrow m => ModelSpec (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim]))) -> Generator generatorDevice -> m (output, Generator generatorOutputDevice) Source #

(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 ForNonLinearity as parameter.

Instance details

Defined in Torch.GraduallyTyped.NN.Linear

Methods

initialize :: MonadThrow m => ModelSpec (GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) ()) -> Generator generatorDevice -> m (output, Generator generatorOutputDevice) Source #

(KnownSymbol name, KnownNat size) => SingI ('Dim ('Name name) ('Size size) :: Dim (Name Symbol) (Size Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

sing :: Sing ('Dim ('Name name) ('Size size)) 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 # 
Instance details

Defined in Torch.GraduallyTyped.NN.Linear

Methods

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 # 
Instance details

Defined in Torch.GraduallyTyped.NN.Linear

Methods

forward :: MonadThrow m => GLinear (Tensor gradient ('Layout 'Dense) device dataType ('Shape '[outputDim, inputDim])) () -> Tensor gradient' layout' device' dataType' shape' -> Generator generatorDevice -> m (output, Generator generatorDevice) Source #

(SGetDim dim, SGetDims dims) => SGetDims (dim ': dims) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetDims :: [String] -> [Integer] -> SList (dim ': dims) Source #

type Demote (Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing = SShape
type Demote (Dim (Name Symbol) (Size Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing = SDim

data SDim (dim :: Dim (Name Symbol) (Size Nat)) where Source #

Constructors

SDim 

Fields

Instances

Instances details
Show (SDim dim) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

showsPrec :: Int -> SDim dim -> ShowS Source #

show :: SDim dim -> String Source #

showList :: [SDim dim] -> ShowS Source #

HasStateDict (SDim dim) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Class

HasInitialize (SDim dim) generatorDevice (SDim dim) generatorDevice Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Class

Methods

initialize :: MonadThrow m => ModelSpec (SDim dim) -> Generator generatorDevice -> m (SDim dim, Generator generatorDevice) Source #

type ModelSpec (SDim dim) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Class

type ModelSpec (SDim dim) = SDim dim

pattern (:&:) :: forall (name :: Name Symbol) (size :: Size Nat). SName name -> SSize size -> SDim ('Dim name size) infix 9 Source #

class KnownDim (dim :: Dim (Name Symbol) (Size Nat)) where Source #

Instances

Instances details
(KnownName name, KnownSize size) => KnownDim ('Dim name size) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

data By (name :: Type) (index :: Type) where Source #

Data type to select dimensions by name or by index.

Constructors

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

Instances details
KnownSelectDim ('UncheckedSelectDim :: SelectDim (By Symbol Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

KnownSelectDims ('UncheckedSelectDims :: SelectDims [By Symbol Nat]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

SingKind (SelectDim (By Symbol Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Associated Types

type Demote (SelectDim (By Symbol Nat)) = (r :: Type) Source #

SingKind (SelectDims [By Symbol Nat]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Associated Types

type Demote (SelectDims [By Symbol Nat]) = (r :: Type) Source #

SingI by => SingI ('SelectDim by :: SelectDim (By Symbol Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

sing :: Sing ('SelectDim by) Source #

SingI bys => SingI ('SelectDims bys :: SelectDims [By Symbol Nat]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

sing :: Sing ('SelectDims bys) Source #

(Show name, Show index) => Show (By name index) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

showsPrec :: Int -> By name index -> ShowS Source #

show :: By name index -> String Source #

showList :: [By name index] -> ShowS Source #

(Eq name, Eq index) => Eq (By name index) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

(==) :: By name index -> By name index -> Bool Source #

(/=) :: By name index -> By name index -> Bool Source #

(Ord name, Ord index) => Ord (By name index) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

compare :: By name index -> By name index -> Ordering Source #

(<) :: By name index -> By name index -> Bool Source #

(<=) :: By name index -> By name index -> Bool Source #

(>) :: By name index -> By name index -> Bool Source #

(>=) :: By name index -> By name index -> Bool Source #

max :: By name index -> By name index -> By name index Source #

min :: By name index -> By name index -> By name index Source #

KnownBy by => KnownSelectDim ('SelectDim by) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

(KnownBy by, KnownSelectDims ('SelectDims bys)) => KnownSelectDims ('SelectDims (by ': bys)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

KnownSelectDims ('SelectDims ('[] :: [By Symbol Nat])) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

SingKind (By Symbol Nat) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Associated Types

type Demote (By Symbol Nat) = (r :: Type) Source #

KnownNat index => SingI ('ByIndex index :: By Symbol Nat) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

sing :: Sing ('ByIndex index) Source #

KnownSymbol name => SingI ('ByName name :: By Symbol Nat) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

sing :: Sing ('ByName name) Source #

type Demote (SelectDim (By Symbol Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Demote (SelectDims [By Symbol Nat]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Demote (By Symbol Nat) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing = SBy

data SBy (by :: By Symbol Nat) where Source #

Constructors

SByName :: forall name. KnownSymbol name => SBy ('ByName name) 
SByIndex :: forall index. KnownNat index => SBy ('ByIndex index) 

Instances

Instances details
Show (SBy by) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

showsPrec :: Int -> SBy by -> ShowS Source #

show :: SBy by -> String Source #

showList :: [SBy by] -> ShowS Source #

type family ByNameF (by :: By Symbol Nat) :: Symbol where ... Source #

Equations

ByNameF ('ByName name) = name 

type family ByIndexF (by :: By Symbol Nat) :: Nat where ... Source #

Equations

ByIndexF ('ByIndex index) = index 

class KnownBy (by :: By Symbol Nat) where Source #

Instances

Instances details
KnownNat index => KnownBy ('ByIndex index :: By Symbol Nat) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

KnownSymbol name => KnownBy ('ByName name :: By Symbol Nat) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

data SelectDim (by :: Type) where Source #

Constructors

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.

Instances

Instances details
SingKind (SelectDim (By Symbol Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Associated Types

type Demote (SelectDim (By Symbol Nat)) = (r :: Type) Source #

SingI by => SingI ('SelectDim by :: SelectDim (By Symbol Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

sing :: Sing ('SelectDim by) Source #

type Demote (SelectDim (By Symbol Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

data SSelectDim (selectDim :: SelectDim (By Symbol Nat)) where Source #

Instances

Instances details
Show (SSelectDim selectDim) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

showsPrec :: Int -> SSelectDim selectDim -> ShowS Source #

show :: SSelectDim selectDim -> String Source #

showList :: [SSelectDim selectDim] -> ShowS Source #

data SelectDims (selectDims :: Type) where Source #

Constructors

UncheckedSelectDims :: forall selectDims. SelectDims selectDims 
SelectDims :: forall selectDims. selectDims -> SelectDims selectDims 

Instances

Instances details
SingKind (SelectDims [By Symbol Nat]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Associated Types

type Demote (SelectDims [By Symbol Nat]) = (r :: Type) Source #

SingI bys => SingI ('SelectDims bys :: SelectDims [By Symbol Nat]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

sing :: Sing ('SelectDims bys) Source #

type Demote (SelectDims [By Symbol Nat]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

data SSelectDims (selectDims :: SelectDims [By Symbol Nat]) where Source #

Instances

Instances details
Show (SSelectDims selectDims) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

showsPrec :: Int -> SSelectDims selectDims -> ShowS Source #

show :: SSelectDims selectDims -> String Source #

showList :: [SSelectDims selectDims] -> ShowS Source #

data Shape (dims :: Type) where Source #

Data type to represent tensor shapes, that is, lists of dimensions.

Constructors

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 UncheckedDim, that is, unknown dimensions.

Instances

Instances details
Show dims => Show (Shape dims) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

showsPrec :: Int -> Shape dims -> ShowS Source #

show :: Shape dims -> String Source #

showList :: [Shape dims] -> ShowS Source #

SingKind (Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Associated Types

type Demote (Shape [Dim (Name Symbol) (Size Nat)]) = (r :: Type) Source #

SingI dims => SingI ('Shape dims :: Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

sing :: Sing ('Shape dims) Source #

type Demote (Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type Sing = SShape

data SShape (shape :: Shape [Dim (Name Symbol) (Size Nat)]) where Source #

Constructors

SUncheckedShape :: [Dim String Integer] -> SShape 'UncheckedShape 
SShape :: forall dims. SList dims -> SShape ('Shape dims) 

Instances

Instances details
Show (SShape shape) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

Methods

showsPrec :: Int -> SShape shape -> ShowS Source #

show :: SShape shape -> String Source #

showList :: [SShape shape] -> ShowS Source #

class KnownShape (shape :: Shape [Dim (Name Symbol) (Size Nat)]) where Source #

Instances

Instances details
KnownShape ('UncheckedShape :: Shape [Dim (Name Symbol) (Size Nat)]) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

(KnownShape ('Shape dims), KnownDim dim) => KnownShape ('Shape (dim ': dims)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

KnownShape ('Shape ('[] :: [Dim (Name Symbol) (Size Nat)])) Source # 
Instance details

Defined in Torch.GraduallyTyped.Shape.Type

type family GetShapes f where ... Source #

Equations

GetShapes (a :: Shape [Dim (Name Symbol) (Size Nat)]) = '[a] 
GetShapes (f g) = Concat (GetShapes f) (GetShapes g) 
GetShapes _ = '[] 

Orphan instances

Castable String (ForeignPtr Dimname) Source # 
Instance details

Methods

cast :: String -> (ForeignPtr Dimname -> IO r) -> IO r Source #

uncast :: ForeignPtr Dimname -> (String -> IO r) -> IO r Source #

Castable [ForeignPtr Dimname] (ForeignPtr DimnameList) Source # 
Instance details

Castable [String] (ForeignPtr DimnameList) Source # 
Instance details

Methods

cast :: [String] -> (ForeignPtr DimnameList -> IO r) -> IO r Source #

uncast :: ForeignPtr DimnameList -> ([String] -> IO r) -> IO r Source #

Castable [Integer] (ForeignPtr IntArray) Source # 
Instance details

Methods

cast :: [Integer] -> (ForeignPtr IntArray -> IO r) -> IO r Source #

uncast :: ForeignPtr IntArray -> ([Integer] -> IO r) -> IO r Source #