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

Torch.GraduallyTyped.NN.Sparse

Documentation

data Embedding (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (embedNumDim :: Dim (Name Symbol) (Size Nat)) (embedDim :: Dim (Name Symbol) (Size Nat)) (paddingIdx :: Maybe Nat) where Source #

Constructors

Embedding 

Fields

  • :: forall gradient layout device dataType embedNumDim embedDim paddingIdx. { embeddingWeight :: Tensor gradient layout device dataType ('Shape '[embedNumDim, embedDim])
     
  •    } -> Embedding gradient layout device dataType embedNumDim embedDim paddingIdx
     

Instances

Instances details
Generic (Embedding gradient layout device dataType embedNumDim embedDim paddingIdx) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Sparse

Associated Types

type Rep (Embedding gradient layout device dataType embedNumDim embedDim paddingIdx) :: Type -> Type Source #

Methods

from :: Embedding gradient layout device dataType embedNumDim embedDim paddingIdx -> Rep (Embedding gradient layout device dataType embedNumDim embedDim paddingIdx) x Source #

to :: Rep (Embedding gradient layout device dataType embedNumDim embedDim paddingIdx) x -> Embedding gradient layout device dataType embedNumDim embedDim paddingIdx Source #

Show (Embedding gradient layout device dataType embedNumDim embedDim paddingIdx) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Sparse

Methods

showsPrec :: Int -> Embedding gradient layout device dataType embedNumDim embedDim paddingIdx -> ShowS Source #

show :: Embedding gradient layout device dataType embedNumDim embedDim paddingIdx -> String Source #

showList :: [Embedding gradient layout device dataType embedNumDim embedDim paddingIdx] -> ShowS Source #

HasStateDict (Embedding gradient layout device dataType embedNumDim embedDim paddingIdx) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Sparse

Methods

fromStateDict :: (MonadIO m, MonadThrow m, MonadState StateDict m) => ModelSpec (Embedding gradient layout device dataType embedNumDim embedDim paddingIdx) -> StateDictKey -> m (Embedding gradient layout device dataType embedNumDim embedDim paddingIdx) Source #

toStateDict :: (MonadThrow m, MonadState StateDict m) => StateDictKey -> Embedding gradient layout device dataType embedNumDim embedDim paddingIdx -> m () Source #

(output ~ Embedding gradient layout (device <+> generatorDevice) dataType embedNumDim embedDim paddingIdx, generatorOutputDevice ~ (device <+> generatorDevice), SGetGeneratorDevice generatorDevice) => HasInitialize (Embedding gradient layout device dataType embedNumDim embedDim paddingIdx) generatorDevice output generatorOutputDevice Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Sparse

Methods

initialize :: MonadThrow m => ModelSpec (Embedding gradient layout device dataType embedNumDim embedDim paddingIdx) -> Generator generatorDevice -> m (output, Generator generatorOutputDevice) Source #

(SGetLayout layout, KnownNat paddingIdx, Catch (dataType' <+> 'DataType 'Int64), output ~ Tensor (gradient <|> gradient') (layout <+> layout') (device <+> device') dataType (EmbeddingF ('Shape '[embedNumDim, embedDim]) shape')) => HasForward (Embedding gradient layout device dataType embedNumDim embedDim ('Just paddingIdx)) (Tensor gradient' layout' device' dataType' shape') generatorDevice output generatorDevice Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Sparse

Methods

forward :: MonadThrow m => Embedding gradient layout device dataType embedNumDim embedDim ('Just paddingIdx) -> Tensor gradient' layout' device' dataType' shape' -> Generator generatorDevice -> m (output, Generator generatorDevice) Source #

(SGetLayout layout, Catch (dataType' <+> 'DataType 'Int64), output ~ Tensor (gradient <|> gradient') (layout <+> layout') (device <+> device') dataType (EmbeddingF ('Shape '[embedNumDim, embedDim]) shape')) => HasForward (Embedding gradient layout device dataType embedNumDim embedDim ('Nothing :: Maybe Nat)) (Tensor gradient' layout' device' dataType' shape') generatorDevice output generatorDevice Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Sparse

Methods

forward :: MonadThrow m => Embedding gradient layout device dataType embedNumDim embedDim 'Nothing -> Tensor gradient' layout' device' dataType' shape' -> Generator generatorDevice -> m (output, Generator generatorDevice) Source #

type Rep (Embedding gradient layout device dataType embedNumDim embedDim paddingIdx) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Sparse

type Rep (Embedding gradient layout device dataType embedNumDim embedDim paddingIdx) = D1 ('MetaData "Embedding" "Torch.GraduallyTyped.NN.Sparse" "hasktorch-gradually-typed-0.2.0.0-1KV1aIPzzbp6JpSr37tC1K" 'False) (C1 ('MetaCons "Embedding" 'PrefixI 'True) (S1 ('MetaSel ('Just "embeddingWeight") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Tensor gradient layout device dataType ('Shape '[embedNumDim, embedDim])))))
type ModelSpec (Embedding gradient layout device dataType embedNumDim embedDim paddingIdx) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Sparse

type ModelSpec (Embedding gradient layout device dataType embedNumDim embedDim paddingIdx) = EmbeddingSpec gradient layout device dataType embedNumDim embedDim paddingIdx

data EmbeddingSpec (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (device :: Device (DeviceType Nat)) (dataType :: DataType DType) (embedNumDim :: Dim (Name Symbol) (Size Nat)) (embedDim :: Dim (Name Symbol) (Size Nat)) (paddingIdx :: Maybe Nat) where Source #

Constructors

EmbeddingSpec :: forall gradient layout device dataType embedNumDim embedDim paddingIdx. SGradient gradient -> SLayout layout -> SDevice device -> SDataType dataType -> SDim embedNumDim -> SDim embedDim -> SMaybe paddingIdx -> EmbeddingSpec gradient layout device dataType embedNumDim embedDim paddingIdx 

Instances

Instances details
Generic (EmbeddingSpec gradient layout device dataType embedNumDim embedDim paddingIdx) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Sparse

Associated Types

type Rep (EmbeddingSpec gradient layout device dataType embedNumDim embedDim paddingIdx) :: Type -> Type Source #

Methods

from :: EmbeddingSpec gradient layout device dataType embedNumDim embedDim paddingIdx -> Rep (EmbeddingSpec gradient layout device dataType embedNumDim embedDim paddingIdx) x Source #

to :: Rep (EmbeddingSpec gradient layout device dataType embedNumDim embedDim paddingIdx) x -> EmbeddingSpec gradient layout device dataType embedNumDim embedDim paddingIdx Source #

Show (EmbeddingSpec gradient layout device dataType embedNumDim embedDim paddingIdx) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Sparse

Methods

showsPrec :: Int -> EmbeddingSpec gradient layout device dataType embedNumDim embedDim paddingIdx -> ShowS Source #

show :: EmbeddingSpec gradient layout device dataType embedNumDim embedDim paddingIdx -> String Source #

showList :: [EmbeddingSpec gradient layout device dataType embedNumDim embedDim paddingIdx] -> ShowS Source #

type Rep (EmbeddingSpec gradient layout device dataType embedNumDim embedDim paddingIdx) Source # 
Instance details

Defined in Torch.GraduallyTyped.NN.Sparse

type Rep (EmbeddingSpec gradient layout device dataType embedNumDim embedDim paddingIdx) = D1 ('MetaData "EmbeddingSpec" "Torch.GraduallyTyped.NN.Sparse" "hasktorch-gradually-typed-0.2.0.0-1KV1aIPzzbp6JpSr37tC1K" 'False) (C1 ('MetaCons "EmbeddingSpec" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SGradient gradient)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SLayout layout)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SDevice device)))) :*: ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SDataType dataType)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SDim embedNumDim))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SDim embedDim)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SMaybe paddingIdx))))))