Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Torch.Typed
Synopsis
- module Torch.HList
- module Torch.Data
- module Torch.Typed.Auxiliary
- module Torch.Typed.Autograd
- module Torch.Typed.Device
- module Torch.Typed.DType
- module Torch.Typed.Factories
- module Torch.Typed.Functional
- module Torch.Typed.NN
- module Torch.Typed.Optim
- class Randomizable spec f | spec -> f where
- class GParameterized (f :: Type -> Type) where
- type GParameters f :: [Type]
- gFlattenParameters :: forall a. f a -> HList (GParameters f)
- gReplaceParameters :: forall a. f a -> HList (GParameters f) -> f a
- class Parameterized (f :: Type) where
- type Parameters f :: [Type]
- flattenParameters :: f -> HList (Parameters f)
- replaceParameters :: f -> HList (Parameters f) -> f
- data MakeIndependent = MakeIndependent
- data ToDependent = ToDependent
- newtype Parameter (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) = UnsafeMkParameter IndependentTensor
- untypeParam :: Parameter device dtype shape -> Parameter
- toDependent :: forall shape dtype device. Parameter device dtype shape -> Tensor device dtype shape
- makeIndependent :: forall shape dtype device. Tensor device dtype shape -> IO (Parameter device dtype shape)
- module Torch.Typed.Serialize
- type family ReplaceDType'' (tensor :: t) (dtype :: DType) :: t where ...
- type family ReplaceDevice'' (tensor :: t) (device :: (DeviceType, Nat)) :: t where ...
- data NamedTensor (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: Shape) where
- FromTensor :: forall device dtype shape' shape. shape ~ ToNats shape' => Tensor device dtype shape -> NamedTensor device dtype shape'
- type family FindDim (a :: Size) (shape :: Shape) :: Nat where ...
- type family ToShape a :: Shape where ...
- type family ToDType a :: DType where ...
- data TensorListUnfold = TensorListUnfold
- data TensorListFold = TensorListFold
- newtype Wrap a = Wrap {
- unWrap :: a
- type family Numel (shape :: [Nat]) :: Nat where ...
- type family MatMulDTypeIsValid (device :: (DeviceType, Nat)) (dtype :: DType) :: Constraint where ...
- type MatMul shape shape' = CheckMatMul shape shape' (ComputeMatMul (Reverse shape) (Reverse shape'))
- type family CheckMatMul (shape :: [Nat]) (shape' :: [Nat]) (result :: Maybe [Nat]) :: [Nat] where ...
- type family ComputeMatMul (reversedShape :: [Nat]) (reversedShape' :: [Nat]) :: Maybe [Nat] where ...
- type family ComparisonDTypeIsValid (device :: (DeviceType, Nat)) (dtype :: DType) :: Constraint where ...
- type family BasicArithmeticDTypeIsValid (device :: (DeviceType, Nat)) (dtype :: DType) :: Constraint where ...
- type Broadcast shape shape' = CheckBroadcast shape shape' (ComputeBroadcast (Reverse shape) (Reverse shape'))
- type family CheckBroadcast (shape :: [Nat]) (shape' :: [Nat]) (result :: Maybe [Nat]) :: [Nat] where ...
- type family ComputeBroadcast (reversedShape :: [Nat]) (reversedShape' :: [Nat]) :: Maybe [Nat] where ...
- data SomeDevice where
- SomeDevice :: forall (device :: (DeviceType, Nat)). KnownDevice device => Proxy device -> SomeDevice
- data SomeDType where
- SomeDType :: forall (dtype :: DType). KnownDType dtype => Proxy dtype -> SomeDType
- data SomeShape where
- SomeShape :: forall (shape :: [Nat]). KnownShape shape => Proxy shape -> SomeShape
- type family All (pred :: a -> Constraint) (l :: [a]) :: Constraint where ...
- class TensorOptions (shape :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)) where
- type family ComputeItemType (ty :: Type) (shape :: [Nat]) :: Type where ...
- type family ComputeHaskellType (dtype :: DType) :: Type where ...
- data UnknownShapeTensor device dtype = forall shape. UnknownShapeTensor (Tensor device dtype shape)
- type CUDATensor deviceIndex = Tensor '('CUDA, deviceIndex)
- type CPUTensor = Tensor '('CPU, 0)
- data Tensor (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) where
- UnsafeMkTensor :: forall device dtype shape. Tensor -> Tensor device dtype shape
- type family IsUnnamed t (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) :: Constraint where ...
- class Unnamed t where
- type UTShape t :: [Nat]
- type UTDevice t :: (DeviceType, Nat)
- type UTDType t :: DType
- toUnnamed :: forall device dtype shape. IsUnnamed t device dtype shape => t -> Tensor device dtype shape
- fromUnnamed :: forall device dtype shape. IsUnnamed t device dtype shape => Tensor device dtype shape -> t
- toDynamic :: t -> Tensor
- type family FromNats (shape :: [Nat]) :: Shape where ...
- type family FromNat (shape :: Nat) :: Size where ...
- type family ToNats (shape :: Shape) :: [Nat] where ...
- type family ToNat (shape :: Size) :: Nat where ...
- type Shape = [Type -> Type]
- type Size = Type -> Type
- class KnownDevice (device :: (DeviceType, Nat)) where
- type family ComputeDType (dtype' :: dtype) :: DType where ...
- class KnownDType (dtype :: DType) where
- class KnownShape (shape :: [Nat]) where
- getFiniteI :: Finite n -> Int
- someShape :: [Int] -> SomeShape
- someDType :: DType -> SomeDType
- someDevice :: Device -> SomeDevice
- withTensor :: Tensor -> (forall shape dtype device. (KnownDevice device, KnownDType dtype, KnownShape shape) => Tensor device dtype shape -> r) -> r
- withTensorShape :: forall device dtype r. (KnownDevice device, KnownDType dtype) => Tensor -> (forall shape. KnownShape shape => Tensor device dtype shape -> r) -> r
- add :: forall shape'' shape shape' dtype dtype' dtype'' device. (dtype'' ~ DTypePromotion dtype dtype', shape'' ~ Broadcast shape shape', BasicArithmeticDTypeIsValid device dtype, BasicArithmeticDTypeIsValid device dtype', BasicArithmeticDTypeIsValid device dtype'') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device dtype'' shape''
- sub :: forall shape'' shape shape' dtype dtype' dtype'' device. (dtype'' ~ DTypePromotion dtype dtype', shape'' ~ Broadcast shape shape', BasicArithmeticDTypeIsValid device dtype, BasicArithmeticDTypeIsValid device dtype', BasicArithmeticDTypeIsValid device dtype'') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device dtype'' shape''
- mul :: forall shape'' shape shape' dtype dtype' dtype'' device. (dtype'' ~ DTypePromotion dtype dtype', shape'' ~ Broadcast shape shape', BasicArithmeticDTypeIsValid device dtype, BasicArithmeticDTypeIsValid device dtype', BasicArithmeticDTypeIsValid device dtype'') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device dtype'' shape''
- div :: forall shape'' shape shape' dtype dtype' dtype'' device. (dtype'' ~ DTypePromotion dtype dtype', shape'' ~ Broadcast shape shape', BasicArithmeticDTypeIsValid device dtype, BasicArithmeticDTypeIsValid device dtype', BasicArithmeticDTypeIsValid device dtype'') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device dtype'' shape''
- gt :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- lt :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- ge :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- le :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- eq :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- ne :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- (>.) :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- (<.) :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- (>=.) :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- (<=.) :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- (==.) :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- (/=.) :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- matmul :: forall shape'' shape shape' dtype device. (shape'' ~ MatMul shape shape', MatMulDTypeIsValid device dtype) => Tensor device dtype shape -> Tensor device dtype shape' -> Tensor device dtype shape''
- select :: forall dim idx shape' shape dtype device. (KnownNat dim, KnownNat idx, InRange shape dim idx, shape' ~ Remove shape dim) => Tensor device dtype shape -> Tensor device dtype shape'
- selectIdx :: forall dim n shape' shape dtype device. (KnownNat dim, n ~ Index shape dim, shape' ~ Remove shape dim) => Tensor device dtype shape -> Finite n -> Tensor device dtype shape'
- reshape :: forall shape' shape dtype device. (KnownShape shape', Numel shape ~ Numel shape') => Tensor device dtype shape -> Tensor device dtype shape'
- toSparse :: Tensor device dtype shape -> Tensor device dtype shape
- toDense :: Tensor device dtype shape -> Tensor device dtype shape
- toCPU :: forall device shape dtype. Tensor device dtype shape -> CPUTensor dtype shape
- toCUDA :: forall device' device shape dtype. Tensor device dtype shape -> CUDATensor 0 dtype shape
- dim :: forall device dtype shape t. (TensorOptions shape dtype device, IsUnnamed t device dtype shape) => t -> Int
- shape :: forall device dtype shape t. (TensorOptions shape dtype device, IsUnnamed t device dtype shape) => t -> [Int]
- dtype :: forall device dtype shape t. (TensorOptions shape dtype device, IsUnnamed t device dtype shape) => t -> DType
- device :: forall device dtype shape t. (TensorOptions shape dtype device, IsUnnamed t device dtype shape) => t -> Device
- toInt :: Tensor device dtype shape -> Int
- toFloat :: forall device. Tensor device 'Float '[] -> Float
- toDouble :: forall device. Tensor device 'Double '[] -> Double
- toBool :: forall device. Tensor device 'Bool '[] -> Bool
- module Torch.Typed.Vision
- data Device = Device {}
- data DeviceType
- data DType
- class Castable a (ForeignPtr Scalar) => Scalar a
- data Reduction
- data Tri
Documentation
module Torch.HList
module Torch.Data
module Torch.Typed.Auxiliary
module Torch.Typed.Autograd
module Torch.Typed.Device
module Torch.Typed.DType
module Torch.Typed.Factories
module Torch.Typed.Functional
module Torch.Typed.NN
module Torch.Typed.Optim
class Randomizable spec f | spec -> f where Source #
Instances
Randomizable BatchNormSpec BatchNorm Source # | |
Randomizable Conv1dSpec Conv1d Source # | |
Randomizable Conv2dSpec Conv2d Source # | |
Randomizable Conv3dSpec Conv3d Source # | |
Randomizable ConvTranspose1dSpec ConvTranspose1d Source # | |
Defined in Torch.NN Methods sample :: ConvTranspose1dSpec -> IO ConvTranspose1d Source # | |
Randomizable ConvTranspose2dSpec ConvTranspose2d Source # | |
Defined in Torch.NN Methods sample :: ConvTranspose2dSpec -> IO ConvTranspose2d Source # | |
Randomizable ConvTranspose3dSpec ConvTranspose3d Source # | |
Defined in Torch.NN Methods sample :: ConvTranspose3dSpec -> IO ConvTranspose3d Source # | |
Randomizable InstanceNormSpec InstanceNorm Source # | |
Defined in Torch.NN Methods sample :: InstanceNormSpec -> IO InstanceNorm Source # | |
Randomizable LinearSpec Linear Source # | |
Randomizable UpSampleSpec UpSample Source # | |
Randomizable ElmanSpec ElmanCell Source # | |
Randomizable GRUSpec GRUCell Source # | |
Randomizable LSTMSpec LSTMCell Source # | |
Randomizable DropoutSpec Dropout Source # | |
Defined in Torch.Typed.NN.Dropout | |
(Randomizable xSpec x, Randomizable (HList xsSpec) (HList xs)) => Randomizable (HList (xSpec ': xsSpec)) (HList (x ': xs)) Source # | |
Randomizable (HList ('[] :: [Type])) (HList ('[] :: [Type])) Source # | |
(TensorOptions normalizedShape dtype device, RandDTypeIsValid device dtype) => Randomizable (LayerNormSpec normalizedShape dtype device) (LayerNorm normalizedShape dtype device) Source # | |
Defined in Torch.Typed.NN.Normalization | |
(KnownNat inputFeatures, KnownNat outputFeatures, KnownDType dtype, KnownDevice device, RandDTypeIsValid device dtype) => Randomizable (LinearSpec inputFeatures outputFeatures dtype device) (Linear inputFeatures outputFeatures dtype device) Source # | |
Defined in Torch.Typed.NN.Linear | |
(KnownDevice device, KnownDType dtype, KnownNat inputDim, KnownNat hiddenDim, RandDTypeIsValid device dtype) => Randomizable (GRUCellSpec inputDim hiddenDim dtype device) (GRUCell inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.GRU | |
(KnownDevice device, KnownDType dtype, KnownNat inputDim, KnownNat hiddenDim, RandDTypeIsValid device dtype) => Randomizable (LSTMCellSpec inputDim hiddenDim dtype device) (LSTMCell inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.LSTM | |
(All KnownNat '[embedDim, ffnDim], KnownDType dtype, KnownDevice device, RandDTypeIsValid device dtype) => Randomizable (TransformerMLPSpec embedDim ffnDim dtype device) (TransformerMLP embedDim ffnDim dtype device) Source # | |
Defined in Torch.Typed.NN.Transformer Methods sample :: TransformerMLPSpec embedDim ffnDim dtype device -> IO (TransformerMLP embedDim ffnDim dtype device) Source # | |
(KnownNat inputChannelSize, KnownNat outputChannelSize, KnownNat kernelSize, KnownDType dtype, KnownDevice device, RandDTypeIsValid device dtype) => Randomizable (Conv1dSpec inputChannelSize outputChannelSize kernelSize dtype device) (Conv1d inputChannelSize outputChannelSize kernelSize dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution | |
(KnownNat inputChannelSize, KnownNat outputChannelSize, KnownNat kernelSize, KnownDType dtype, KnownDevice device, RandDTypeIsValid device dtype) => Randomizable (ConvTranspose1dSpec inputChannelSize outputChannelSize kernelSize dtype device) (ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution Methods sample :: ConvTranspose1dSpec inputChannelSize outputChannelSize kernelSize dtype device -> IO (ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device) Source # | |
(RandDTypeIsValid device dtype, KnownNat inputSize, KnownNat hiddenSize, KnownDType dtype, KnownDevice device) => Randomizable (GRULayerSpec inputSize hiddenSize 'Bidirectional dtype device) (GRULayer inputSize hiddenSize 'Bidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU Methods sample :: GRULayerSpec inputSize hiddenSize 'Bidirectional dtype device -> IO (GRULayer inputSize hiddenSize 'Bidirectional dtype device) Source # | |
(RandDTypeIsValid device dtype, KnownNat inputSize, KnownNat hiddenSize, KnownDType dtype, KnownDevice device) => Randomizable (GRULayerSpec inputSize hiddenSize 'Unidirectional dtype device) (GRULayer inputSize hiddenSize 'Unidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU Methods sample :: GRULayerSpec inputSize hiddenSize 'Unidirectional dtype device -> IO (GRULayer inputSize hiddenSize 'Unidirectional dtype device) Source # | |
(RandDTypeIsValid device dtype, KnownNat inputSize, KnownNat hiddenSize, KnownDType dtype, KnownDevice device) => Randomizable (LSTMLayerSpec inputSize hiddenSize 'Bidirectional dtype device) (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM Methods sample :: LSTMLayerSpec inputSize hiddenSize 'Bidirectional dtype device -> IO (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device) Source # | |
(RandDTypeIsValid device dtype, KnownNat inputSize, KnownNat hiddenSize, KnownDType dtype, KnownDevice device) => Randomizable (LSTMLayerSpec inputSize hiddenSize 'Unidirectional dtype device) (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM Methods sample :: LSTMLayerSpec inputSize hiddenSize 'Unidirectional dtype device -> IO (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device) Source # | |
(KnownNat inputChannelSize, KnownNat outputChannelSize, KnownNat kernelSize0, KnownNat kernelSize1, KnownDType dtype, KnownDevice device, RandDTypeIsValid device dtype) => Randomizable (Conv2dSpec inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) (Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution | |
(KnownNat inputChannelSize, KnownNat outputChannelSize, KnownNat kernelSize0, KnownNat kernelSize1, KnownDType dtype, KnownDevice device, RandDTypeIsValid device dtype) => Randomizable (ConvTranspose2dSpec inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) (ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution Methods sample :: ConvTranspose2dSpec inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device -> IO (ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) Source # | |
(1 <= numLayers, (2 <=? numLayers) ~ flag, RandDTypeIsValid device dtype, KnownDType dtype, KnownDevice device, GRULayerStackRandomizable flag inputSize hiddenSize numLayers directionality dtype device) => Randomizable (GRULayerStackSpec inputSize hiddenSize numLayers directionality dtype device) (GRULayerStack inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU Methods sample :: GRULayerStackSpec inputSize hiddenSize numLayers directionality dtype device -> IO (GRULayerStack inputSize hiddenSize numLayers directionality dtype device) Source # | |
(KnownDType dtype, KnownDevice device, KnownNat inputSize, KnownNat hiddenSize, KnownNat (NumberOfDirections directionality), RandDTypeIsValid device dtype, Randomizable (GRULayerStackSpec inputSize hiddenSize numLayers directionality dtype device) (GRULayerStack inputSize hiddenSize numLayers directionality dtype device), 1 <= numLayers) => Randomizable (GRUSpec inputSize hiddenSize numLayers directionality dtype device) (GRU inputSize hiddenSize numLayers directionality dtype device) Source # | |
(1 <= numLayers, (2 <=? numLayers) ~ flag, RandDTypeIsValid device dtype, KnownDType dtype, KnownDevice device, LSTMLayerStackRandomizable flag inputSize hiddenSize numLayers directionality dtype device) => Randomizable (LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device) (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM Methods sample :: LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device -> IO (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) Source # | |
(KnownDType dtype, KnownDevice device, KnownNat inputSize, KnownNat hiddenSize, KnownNat (NumberOfDirections directionality), RandDTypeIsValid device dtype, Randomizable (LSTMLayerStackSpec inputSize hiddenSize numLayers directionality dtype device) (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device), 1 <= numLayers) => Randomizable (LSTMSpec inputSize hiddenSize numLayers directionality dtype device) (LSTM inputSize hiddenSize numLayers directionality dtype device) Source # | |
(paddingIdx <= numEmbeds, 1 <= (numEmbeds - paddingIdx), (((numEmbeds - paddingIdx) - 1) + (1 + paddingIdx)) ~ numEmbeds, KnownNat paddingIdx, KnownNat numEmbeds, KnownNat embedSize, KnownDType dtype, KnownDevice device, RandDTypeIsValid device dtype) => Randomizable (EmbeddingSpec ('Just paddingIdx) numEmbeds embedSize 'Learned dtype device) (Embedding ('Just paddingIdx) numEmbeds embedSize 'Learned dtype device) Source # | |
(KnownNat numEmbeds, KnownNat embedSize, KnownDType dtype, KnownDevice device, RandDTypeIsValid device dtype) => Randomizable (EmbeddingSpec ('Nothing :: Maybe Nat) numEmbeds embedSize 'Learned dtype device) (Embedding ('Nothing :: Maybe Nat) numEmbeds embedSize 'Learned dtype device) Source # | |
Randomizable (EmbeddingSpec paddingIdx numEmbeds embedSize 'Constant dtype device) (Embedding paddingIdx numEmbeds embedSize 'Constant dtype device) Source # | |
Defined in Torch.Typed.NN.Sparse | |
(All KnownNat '[embedDim, kEmbedDim, vEmbedDim, numHeads], KnownDType dtype, KnownDevice device, RandDTypeIsValid device dtype) => Randomizable (MultiheadAttentionSpec embedDim kEmbedDim vEmbedDim numHeads dtype device) (MultiheadAttention embedDim kEmbedDim vEmbedDim numHeads dtype device) Source # | |
Defined in Torch.Typed.NN.Transformer Methods sample :: MultiheadAttentionSpec embedDim kEmbedDim vEmbedDim numHeads dtype device -> IO (MultiheadAttention embedDim kEmbedDim vEmbedDim numHeads dtype device) Source # | |
(KnownNat inputChannelSize, KnownNat outputChannelSize, KnownNat kernelSize0, KnownNat kernelSize1, KnownNat kernelSize2, KnownDType dtype, KnownDevice device, RandDTypeIsValid device dtype) => Randomizable (Conv3dSpec inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) (Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution | |
(KnownNat inputChannelSize, KnownNat outputChannelSize, KnownNat kernelSize0, KnownNat kernelSize1, KnownNat kernelSize2, KnownDType dtype, KnownDevice device, RandDTypeIsValid device dtype) => Randomizable (ConvTranspose3dSpec inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) (ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution Methods sample :: ConvTranspose3dSpec inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device -> IO (ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) Source # | |
(KnownNat hiddenSize, KnownNat numLayers, KnownNat (NumberOfDirections directionality), KnownDType dtype, KnownDevice device, Randomizable (GRUSpec inputSize hiddenSize numLayers directionality dtype device) (GRU inputSize hiddenSize numLayers directionality dtype device)) => Randomizable (GRUWithInitSpec inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) (GRUWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU Methods sample :: GRUWithInitSpec inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device -> IO (GRUWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) Source # | |
(KnownNat hiddenSize, KnownNat numLayers, KnownNat (NumberOfDirections directionality), KnownDType dtype, KnownDevice device, Randomizable (GRUSpec inputSize hiddenSize numLayers directionality dtype device) (GRU inputSize hiddenSize numLayers directionality dtype device)) => Randomizable (GRUWithInitSpec inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) (GRUWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU Methods sample :: GRUWithInitSpec inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device -> IO (GRUWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) Source # | |
(KnownNat hiddenSize, KnownNat numLayers, KnownNat (NumberOfDirections directionality), KnownDType dtype, KnownDevice device, Randomizable (LSTMSpec inputSize hiddenSize numLayers directionality dtype device) (LSTM inputSize hiddenSize numLayers directionality dtype device)) => Randomizable (LSTMWithInitSpec inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM Methods sample :: LSTMWithInitSpec inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device -> IO (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) Source # | |
(KnownNat hiddenSize, KnownNat numLayers, KnownNat (NumberOfDirections directionality), KnownDType dtype, KnownDevice device, Randomizable (LSTMSpec inputSize hiddenSize numLayers directionality dtype device) (LSTM inputSize hiddenSize numLayers directionality dtype device)) => Randomizable (LSTMWithInitSpec inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM Methods sample :: LSTMWithInitSpec inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device -> IO (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) Source # | |
(All KnownNat '[embedDim, kEmbedDim, vEmbedDim, numHeads, ffnDim], KnownDType dtype, KnownDevice device, RandDTypeIsValid device dtype) => Randomizable (TransformerLayerSpec embedDim kEmbedDim vEmbedDim numHeads ffnDim dtype device) (TransformerLayer embedDim kEmbedDim vEmbedDim numHeads ffnDim dtype device) Source # | |
Defined in Torch.Typed.NN.Transformer Methods sample :: TransformerLayerSpec embedDim kEmbedDim vEmbedDim numHeads ffnDim dtype device -> IO (TransformerLayer embedDim kEmbedDim vEmbedDim numHeads ffnDim dtype device) Source # | |
(paddingIdx <= numEmbeds, 1 <= (numEmbeds - paddingIdx), 1 <= Div embedDim 2, (((numEmbeds - paddingIdx) - 1) + (1 + paddingIdx)) ~ numEmbeds, (Div embedDim 2 * 2) ~ embedDim, All KnownNat '[ffnDim, paddingIdx, numEmbeds, embedDim], HReplicate numAttnLayers (TransformerLayerSpec embedDim embedDim embedDim numHeads ffnDim dtype device), Randomizable (HList (HReplicateR numAttnLayers (TransformerLayerSpec embedDim embedDim embedDim numHeads ffnDim dtype device))) (HList (HReplicateR numAttnLayers (TransformerLayer embedDim embedDim embedDim numHeads ffnDim dtype device))), KnownDType dtype, RandDTypeIsValid device dtype, StandardFloatingPointDTypeValidation device 'Float, BasicArithmeticDTypeIsValid device 'Float, KnownDevice device) => Randomizable (TransformerLMSpec numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device) (TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device) Source # | |
Defined in Torch.Typed.NN.Transformer Methods sample :: TransformerLMSpec numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device -> IO (TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device) Source # |
class GParameterized (f :: Type -> Type) where Source #
Associated Types
type GParameters f :: [Type] Source #
Methods
gFlattenParameters :: forall a. f a -> HList (GParameters f) Source #
gReplaceParameters :: forall a. f a -> HList (GParameters f) -> f a Source #
Instances
class Parameterized (f :: Type) where Source #
Minimal complete definition
Nothing
Methods
flattenParameters :: f -> HList (Parameters f) Source #
default flattenParameters :: (Generic f, GParameterized (Rep f), Parameters f ~ GParameters (Rep f)) => f -> HList (Parameters f) Source #
replaceParameters :: f -> HList (Parameters f) -> f Source #
default replaceParameters :: (Generic f, GParameterized (Rep f), Parameters f ~ GParameters (Rep f)) => f -> HList (Parameters f) -> f Source #
Instances
Parameterized Dropout Source # | |
Defined in Torch.Typed.NN.Dropout Associated Types type Parameters Dropout :: [Type] Source # Methods flattenParameters :: Dropout -> HList (Parameters Dropout) Source # replaceParameters :: Dropout -> HList (Parameters Dropout) -> Dropout Source # | |
Parameterized GD Source # | |
Defined in Torch.Typed.Optim Associated Types type Parameters GD :: [Type] Source # Methods flattenParameters :: GD -> HList (Parameters GD) Source # replaceParameters :: GD -> HList (Parameters GD) -> GD Source # | |
Parameterized Double Source # | |
Defined in Torch.Typed.Parameter Associated Types type Parameters Double :: [Type] Source # Methods flattenParameters :: Double -> HList (Parameters Double) Source # replaceParameters :: Double -> HList (Parameters Double) -> Double Source # | |
Parameterized Float Source # | |
Defined in Torch.Typed.Parameter Associated Types type Parameters Float :: [Type] Source # Methods flattenParameters :: Float -> HList (Parameters Float) Source # replaceParameters :: Float -> HList (Parameters Float) -> Float Source # | |
Parameterized Int Source # | |
Defined in Torch.Typed.Parameter Associated Types type Parameters Int :: [Type] Source # Methods flattenParameters :: Int -> HList (Parameters Int) Source # replaceParameters :: Int -> HList (Parameters Int) -> Int Source # | |
HAppendFD momenta momenta (momenta ++ momenta) => Parameterized (Adam momenta) Source # | |
Defined in Torch.Typed.Optim Associated Types type Parameters (Adam momenta) :: [Type] Source # Methods flattenParameters :: Adam momenta -> HList (Parameters (Adam momenta)) Source # replaceParameters :: Adam momenta -> HList (Parameters (Adam momenta)) -> Adam momenta Source # | |
Parameterized (GDM momenta) Source # | |
Defined in Torch.Typed.Optim Associated Types type Parameters (GDM momenta) :: [Type] Source # Methods flattenParameters :: GDM momenta -> HList (Parameters (GDM momenta)) Source # replaceParameters :: GDM momenta -> HList (Parameters (GDM momenta)) -> GDM momenta Source # | |
(Parameterized f, Parameterized (HList fs), HAppendFD (Parameters f) (Parameters (HList fs)) (Parameters f ++ Parameters (HList fs))) => Parameterized (HList (f ': fs)) Source # | |
Defined in Torch.Typed.Parameter Associated Types type Parameters (HList (f ': fs)) :: [Type] Source # Methods flattenParameters :: HList (f ': fs) -> HList (Parameters (HList (f ': fs))) Source # replaceParameters :: HList (f ': fs) -> HList (Parameters (HList (f ': fs))) -> HList (f ': fs) Source # | |
Parameterized (HList ('[] :: [k])) Source # | |
Defined in Torch.Typed.Parameter Associated Types type Parameters (HList '[]) :: [Type] Source # Methods flattenParameters :: HList '[] -> HList (Parameters (HList '[])) Source # replaceParameters :: HList '[] -> HList (Parameters (HList '[])) -> HList '[] Source # | |
Parameterized (LayerNorm normalizedShape dtype device) Source # | |
Defined in Torch.Typed.NN.Normalization Associated Types type Parameters (LayerNorm normalizedShape dtype device) :: [Type] Source # Methods flattenParameters :: LayerNorm normalizedShape dtype device -> HList (Parameters (LayerNorm normalizedShape dtype device)) Source # replaceParameters :: LayerNorm normalizedShape dtype device -> HList (Parameters (LayerNorm normalizedShape dtype device)) -> LayerNorm normalizedShape dtype device Source # | |
Parameterized (Parameter device dtype shape) Source # | |
Defined in Torch.Typed.Parameter Associated Types type Parameters (Parameter device dtype shape) :: [Type] Source # Methods flattenParameters :: Parameter device dtype shape -> HList (Parameters (Parameter device dtype shape)) Source # replaceParameters :: Parameter device dtype shape -> HList (Parameters (Parameter device dtype shape)) -> Parameter device dtype shape Source # | |
Parameterized (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Parameter Associated Types type Parameters (Tensor device dtype shape) :: [Type] Source # Methods flattenParameters :: Tensor device dtype shape -> HList (Parameters (Tensor device dtype shape)) Source # replaceParameters :: Tensor device dtype shape -> HList (Parameters (Tensor device dtype shape)) -> Tensor device dtype shape Source # | |
Parameterized (Linear inputFeatures outputFeatures dtype device) Source # | |
Defined in Torch.Typed.NN.Linear Associated Types type Parameters (Linear inputFeatures outputFeatures dtype device) :: [Type] Source # Methods flattenParameters :: Linear inputFeatures outputFeatures dtype device -> HList (Parameters (Linear inputFeatures outputFeatures dtype device)) Source # replaceParameters :: Linear inputFeatures outputFeatures dtype device -> HList (Parameters (Linear inputFeatures outputFeatures dtype device)) -> Linear inputFeatures outputFeatures dtype device Source # | |
Parameterized (GRUCell inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.GRU Associated Types type Parameters (GRUCell inputDim hiddenDim dtype device) :: [Type] Source # Methods flattenParameters :: GRUCell inputDim hiddenDim dtype device -> HList (Parameters (GRUCell inputDim hiddenDim dtype device)) Source # replaceParameters :: GRUCell inputDim hiddenDim dtype device -> HList (Parameters (GRUCell inputDim hiddenDim dtype device)) -> GRUCell inputDim hiddenDim dtype device Source # | |
Parameterized (LSTMCell inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.LSTM Associated Types type Parameters (LSTMCell inputDim hiddenDim dtype device) :: [Type] Source # Methods flattenParameters :: LSTMCell inputDim hiddenDim dtype device -> HList (Parameters (LSTMCell inputDim hiddenDim dtype device)) Source # replaceParameters :: LSTMCell inputDim hiddenDim dtype device -> HList (Parameters (LSTMCell inputDim hiddenDim dtype device)) -> LSTMCell inputDim hiddenDim dtype device Source # | |
Parameterized (TransformerMLP embedDim ffnDim dtype device) Source # | |
Defined in Torch.Typed.NN.Transformer Associated Types type Parameters (TransformerMLP embedDim ffnDim dtype device) :: [Type] Source # Methods flattenParameters :: TransformerMLP embedDim ffnDim dtype device -> HList (Parameters (TransformerMLP embedDim ffnDim dtype device)) Source # replaceParameters :: TransformerMLP embedDim ffnDim dtype device -> HList (Parameters (TransformerMLP embedDim ffnDim dtype device)) -> TransformerMLP embedDim ffnDim dtype device Source # | |
Parameterized (Conv1d inputChannelSize outputChannelSize kernelSize dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution Associated Types type Parameters (Conv1d inputChannelSize outputChannelSize kernelSize dtype device) :: [Type] Source # Methods flattenParameters :: Conv1d inputChannelSize outputChannelSize kernelSize dtype device -> HList (Parameters (Conv1d inputChannelSize outputChannelSize kernelSize dtype device)) Source # replaceParameters :: Conv1d inputChannelSize outputChannelSize kernelSize dtype device -> HList (Parameters (Conv1d inputChannelSize outputChannelSize kernelSize dtype device)) -> Conv1d inputChannelSize outputChannelSize kernelSize dtype device Source # | |
Parameterized (ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution Associated Types type Parameters (ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device) :: [Type] Source # Methods flattenParameters :: ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device -> HList (Parameters (ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device)) Source # replaceParameters :: ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device -> HList (Parameters (ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device)) -> ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device Source # | |
Parameterized (GRULayer inputSize hiddenSize 'Bidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU Associated Types type Parameters (GRULayer inputSize hiddenSize 'Bidirectional dtype device) :: [Type] Source # Methods flattenParameters :: GRULayer inputSize hiddenSize 'Bidirectional dtype device -> HList (Parameters (GRULayer inputSize hiddenSize 'Bidirectional dtype device)) Source # replaceParameters :: GRULayer inputSize hiddenSize 'Bidirectional dtype device -> HList (Parameters (GRULayer inputSize hiddenSize 'Bidirectional dtype device)) -> GRULayer inputSize hiddenSize 'Bidirectional dtype device Source # | |
Parameterized (GRULayer inputSize hiddenSize 'Unidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU Associated Types type Parameters (GRULayer inputSize hiddenSize 'Unidirectional dtype device) :: [Type] Source # Methods flattenParameters :: GRULayer inputSize hiddenSize 'Unidirectional dtype device -> HList (Parameters (GRULayer inputSize hiddenSize 'Unidirectional dtype device)) Source # replaceParameters :: GRULayer inputSize hiddenSize 'Unidirectional dtype device -> HList (Parameters (GRULayer inputSize hiddenSize 'Unidirectional dtype device)) -> GRULayer inputSize hiddenSize 'Unidirectional dtype device Source # | |
Parameterized (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM Associated Types type Parameters (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device) :: [Type] Source # Methods flattenParameters :: LSTMLayer inputSize hiddenSize 'Bidirectional dtype device -> HList (Parameters (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device)) Source # replaceParameters :: LSTMLayer inputSize hiddenSize 'Bidirectional dtype device -> HList (Parameters (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device)) -> LSTMLayer inputSize hiddenSize 'Bidirectional dtype device Source # | |
Parameterized (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM Associated Types type Parameters (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device) :: [Type] Source # Methods flattenParameters :: LSTMLayer inputSize hiddenSize 'Unidirectional dtype device -> HList (Parameters (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device)) Source # replaceParameters :: LSTMLayer inputSize hiddenSize 'Unidirectional dtype device -> HList (Parameters (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device)) -> LSTMLayer inputSize hiddenSize 'Unidirectional dtype device Source # | |
Parameterized (Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution Associated Types type Parameters (Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) :: [Type] Source # Methods flattenParameters :: Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device -> HList (Parameters (Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device)) Source # replaceParameters :: Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device -> HList (Parameters (Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device)) -> Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device Source # | |
Parameterized (ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution Associated Types type Parameters (ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) :: [Type] Source # Methods flattenParameters :: ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device -> HList (Parameters (ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device)) Source # replaceParameters :: ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device -> HList (Parameters (ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device)) -> ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device Source # | |
(1 <= numLayers, Parameterized (GRULayerStack inputSize hiddenSize numLayers directionality dtype device), HAppendFD (Parameters (GRULayerStack inputSize hiddenSize numLayers directionality dtype device)) (Parameters Dropout) (Parameters (GRULayerStack inputSize hiddenSize numLayers directionality dtype device) ++ Parameters Dropout)) => Parameterized (GRU inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU Associated Types type Parameters (GRU inputSize hiddenSize numLayers directionality dtype device) :: [Type] Source # Methods flattenParameters :: GRU inputSize hiddenSize numLayers directionality dtype device -> HList (Parameters (GRU inputSize hiddenSize numLayers directionality dtype device)) Source # replaceParameters :: GRU inputSize hiddenSize numLayers directionality dtype device -> HList (Parameters (GRU inputSize hiddenSize numLayers directionality dtype device)) -> GRU inputSize hiddenSize numLayers directionality dtype device Source # | |
(1 <= numLayers, (2 <=? numLayers) ~ flag, GRULayerStackParameterized flag inputSize hiddenSize numLayers directionality dtype device) => Parameterized (GRULayerStack inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU Associated Types type Parameters (GRULayerStack inputSize hiddenSize numLayers directionality dtype device) :: [Type] Source # Methods flattenParameters :: GRULayerStack inputSize hiddenSize numLayers directionality dtype device -> HList (Parameters (GRULayerStack inputSize hiddenSize numLayers directionality dtype device)) Source # replaceParameters :: GRULayerStack inputSize hiddenSize numLayers directionality dtype device -> HList (Parameters (GRULayerStack inputSize hiddenSize numLayers directionality dtype device)) -> GRULayerStack inputSize hiddenSize numLayers directionality dtype device Source # | |
(1 <= numLayers, Parameterized (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device), HAppendFD (Parameters (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device)) (Parameters Dropout) (Parameters (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) ++ Parameters Dropout)) => Parameterized (LSTM inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM Associated Types type Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device) :: [Type] Source # Methods flattenParameters :: LSTM inputSize hiddenSize numLayers directionality dtype device -> HList (Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device)) Source # replaceParameters :: LSTM inputSize hiddenSize numLayers directionality dtype device -> HList (Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device)) -> LSTM inputSize hiddenSize numLayers directionality dtype device Source # | |
(1 <= numLayers, (2 <=? numLayers) ~ flag, LSTMLayerStackParameterized flag inputSize hiddenSize numLayers directionality dtype device) => Parameterized (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM Associated Types type Parameters (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) :: [Type] Source # Methods flattenParameters :: LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device -> HList (Parameters (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device)) Source # replaceParameters :: LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device -> HList (Parameters (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device)) -> LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device Source # | |
Parameterized (Embedding paddingIdx numEmbeds embedSize 'Constant dtype device) Source # | |
Defined in Torch.Typed.NN.Sparse Associated Types type Parameters (Embedding paddingIdx numEmbeds embedSize 'Constant dtype device) :: [Type] Source # Methods flattenParameters :: Embedding paddingIdx numEmbeds embedSize 'Constant dtype device -> HList (Parameters (Embedding paddingIdx numEmbeds embedSize 'Constant dtype device)) Source # replaceParameters :: Embedding paddingIdx numEmbeds embedSize 'Constant dtype device -> HList (Parameters (Embedding paddingIdx numEmbeds embedSize 'Constant dtype device)) -> Embedding paddingIdx numEmbeds embedSize 'Constant dtype device Source # | |
Parameterized (Embedding paddingIdx numEmbeds embedSize 'Learned dtype device) Source # | |
Defined in Torch.Typed.NN.Sparse Associated Types type Parameters (Embedding paddingIdx numEmbeds embedSize 'Learned dtype device) :: [Type] Source # Methods flattenParameters :: Embedding paddingIdx numEmbeds embedSize 'Learned dtype device -> HList (Parameters (Embedding paddingIdx numEmbeds embedSize 'Learned dtype device)) Source # replaceParameters :: Embedding paddingIdx numEmbeds embedSize 'Learned dtype device -> HList (Parameters (Embedding paddingIdx numEmbeds embedSize 'Learned dtype device)) -> Embedding paddingIdx numEmbeds embedSize 'Learned dtype device Source # | |
Parameterized (MultiheadAttention embedDim kEmbedDim vEmbedDim numHeads dtype device) Source # | |
Defined in Torch.Typed.NN.Transformer Associated Types type Parameters (MultiheadAttention embedDim kEmbedDim vEmbedDim numHeads dtype device) :: [Type] Source # Methods flattenParameters :: MultiheadAttention embedDim kEmbedDim vEmbedDim numHeads dtype device -> HList (Parameters (MultiheadAttention embedDim kEmbedDim vEmbedDim numHeads dtype device)) Source # replaceParameters :: MultiheadAttention embedDim kEmbedDim vEmbedDim numHeads dtype device -> HList (Parameters (MultiheadAttention embedDim kEmbedDim vEmbedDim numHeads dtype device)) -> MultiheadAttention embedDim kEmbedDim vEmbedDim numHeads dtype device Source # | |
Parameterized (Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution Associated Types type Parameters (Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) :: [Type] Source # Methods flattenParameters :: Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device -> HList (Parameters (Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device)) Source # replaceParameters :: Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device -> HList (Parameters (Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device)) -> Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device Source # | |
Parameterized (ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution Associated Types type Parameters (ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) :: [Type] Source # Methods flattenParameters :: ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device -> HList (Parameters (ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device)) Source # replaceParameters :: ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device -> HList (Parameters (ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device)) -> ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device Source # | |
(Parameterized (GRU inputSize hiddenSize numLayers directionality dtype device), HAppendFD (Parameters (GRU inputSize hiddenSize numLayers directionality dtype device)) ('[] :: [Type]) (Parameters (GRU inputSize hiddenSize numLayers directionality dtype device) ++ ('[] :: [Type]))) => Parameterized (GRUWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU Associated Types type Parameters (GRUWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) :: [Type] Source # Methods flattenParameters :: GRUWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device -> HList (Parameters (GRUWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device)) Source # replaceParameters :: GRUWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device -> HList (Parameters (GRUWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device)) -> GRUWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device Source # | |
(Parameterized (GRU inputSize hiddenSize numLayers directionality dtype device), HAppendFD (Parameters (GRU inputSize hiddenSize numLayers directionality dtype device)) '[Parameter device dtype '[numLayers * NumberOfDirections directionality, hiddenSize]] (Parameters (GRU inputSize hiddenSize numLayers directionality dtype device) ++ '[Parameter device dtype '[numLayers * NumberOfDirections directionality, hiddenSize]])) => Parameterized (GRUWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU Associated Types type Parameters (GRUWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) :: [Type] Source # Methods flattenParameters :: GRUWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device -> HList (Parameters (GRUWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device)) Source # replaceParameters :: GRUWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device -> HList (Parameters (GRUWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device)) -> GRUWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device Source # | |
(Parameterized (LSTM inputSize hiddenSize numLayers directionality dtype device), HAppendFD (Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device)) ('[] :: [Type]) (Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device) ++ ('[] :: [Type]))) => Parameterized (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM Associated Types type Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) :: [Type] Source # Methods flattenParameters :: LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device -> HList (Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device)) Source # replaceParameters :: LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device -> HList (Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device)) -> LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device Source # | |
(Parameterized (LSTM inputSize hiddenSize numLayers directionality dtype device), HAppendFD (Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device)) '[Parameter device dtype '[numLayers * NumberOfDirections directionality, hiddenSize], Parameter device dtype '[numLayers * NumberOfDirections directionality, hiddenSize]] (Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device) ++ '[Parameter device dtype '[numLayers * NumberOfDirections directionality, hiddenSize], Parameter device dtype '[numLayers * NumberOfDirections directionality, hiddenSize]])) => Parameterized (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM Associated Types type Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) :: [Type] Source # Methods flattenParameters :: LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device -> HList (Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device)) Source # replaceParameters :: LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device -> HList (Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device)) -> LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device Source # | |
Parameterized (TransformerLayer embedDim kEmbedDim vEmbedDim numHeads ffnDim dtype device) Source # | |
Defined in Torch.Typed.NN.Transformer Associated Types type Parameters (TransformerLayer embedDim kEmbedDim vEmbedDim numHeads ffnDim dtype device) :: [Type] Source # Methods flattenParameters :: TransformerLayer embedDim kEmbedDim vEmbedDim numHeads ffnDim dtype device -> HList (Parameters (TransformerLayer embedDim kEmbedDim vEmbedDim numHeads ffnDim dtype device)) Source # replaceParameters :: TransformerLayer embedDim kEmbedDim vEmbedDim numHeads ffnDim dtype device -> HList (Parameters (TransformerLayer embedDim kEmbedDim vEmbedDim numHeads ffnDim dtype device)) -> TransformerLayer embedDim kEmbedDim vEmbedDim numHeads ffnDim dtype device Source # | |
(layers ~ HReplicateR numAttnLayers (TransformerLayer embedDim embedDim embedDim numHeads ffnDim dtype device), Parameterized (HList layers), HAppendFD (Parameters (HList layers)) '[Parameter device dtype '[numEmbeds, embedDim], Parameter device dtype '[numEmbeds]] (Parameters (HList layers) ++ '[Parameter device dtype '[numEmbeds, embedDim], Parameter device dtype '[numEmbeds]])) => Parameterized (TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device) Source # | |
Defined in Torch.Typed.NN.Transformer Associated Types type Parameters (TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device) :: [Type] Source # Methods flattenParameters :: TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device -> HList (Parameters (TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device)) Source # replaceParameters :: TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device -> HList (Parameters (TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device)) -> TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device Source # |
data MakeIndependent Source #
Constructors
MakeIndependent |
Instances
Apply' MakeIndependent (Tensor device dtype shape) (IO (Parameter device dtype shape)) Source # | |
Defined in Torch.Typed.Parameter |
data ToDependent Source #
Constructors
ToDependent |
Instances
Apply' ToDependent (Parameter device dtype shape) (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Parameter |
newtype Parameter (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) Source #
Constructors
UnsafeMkParameter IndependentTensor |
Instances
KnownDType dtype' => HasToDType (dtype' :: DType) (dtype :: DType) (Parameter device dtype shape) (Parameter device dtype' shape) Source # | |
KnownDevice device' => HasToDevice device' device (Parameter device dtype shape) (Parameter device' dtype shape) Source # | |
Apply' MakeIndependent (Tensor device dtype shape) (IO (Parameter device dtype shape)) Source # | |
Defined in Torch.Typed.Parameter | |
Apply' ToParameter (Tensor dev dtype shape) (Parameter dev dtype shape) Source # | |
Defined in Torch.Typed.Optim.CppOptim | |
Apply' ToDependent (Parameter device dtype shape) (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Parameter | |
Show (Parameter device dtype shape) Source # | |
Parameterized (Parameter device dtype shape) Source # | |
Defined in Torch.Typed.Parameter Associated Types type Parameters (Parameter device dtype shape) :: [Type] Source # Methods flattenParameters :: Parameter device dtype shape -> HList (Parameters (Parameter device dtype shape)) Source # replaceParameters :: Parameter device dtype shape -> HList (Parameters (Parameter device dtype shape)) -> Parameter device dtype shape Source # | |
HasGrad (Parameter device dtype shape) (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Autograd | |
type Parameters (Parameter device dtype shape) Source # | |
Defined in Torch.Typed.Parameter |
untypeParam :: Parameter device dtype shape -> Parameter Source #
toDependent :: forall shape dtype device. Parameter device dtype shape -> Tensor device dtype shape Source #
makeIndependent :: forall shape dtype device. Tensor device dtype shape -> IO (Parameter device dtype shape) Source #
module Torch.Typed.Serialize
type family ReplaceDType'' (tensor :: t) (dtype :: DType) :: t where ... Source #
Equations
ReplaceDType'' (Tensor device dtype0 shape) dtype1 = Tensor device dtype1 shape | |
ReplaceDType'' (NamedTensor device dtype0 shape) dtype1 = NamedTensor device dtype1 shape |
type family ReplaceDevice'' (tensor :: t) (device :: (DeviceType, Nat)) :: t where ... Source #
Equations
ReplaceDevice'' (Tensor device0 dtype shape) device1 = Tensor device1 dtype shape | |
ReplaceDevice'' (NamedTensor device0 dtype shape) device1 = NamedTensor device1 dtype shape |
data NamedTensor (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: Shape) where Source #
Constructors
FromTensor :: forall device dtype shape' shape. shape ~ ToNats shape' => Tensor device dtype shape -> NamedTensor device dtype shape' |
Instances
KnownDevice device => Num (NamedTensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor Methods (+) :: NamedTensor device dtype shape -> NamedTensor device dtype shape -> NamedTensor device dtype shape Source # (-) :: NamedTensor device dtype shape -> NamedTensor device dtype shape -> NamedTensor device dtype shape Source # (*) :: NamedTensor device dtype shape -> NamedTensor device dtype shape -> NamedTensor device dtype shape Source # negate :: NamedTensor device dtype shape -> NamedTensor device dtype shape Source # abs :: NamedTensor device dtype shape -> NamedTensor device dtype shape Source # signum :: NamedTensor device dtype shape -> NamedTensor device dtype shape Source # fromInteger :: Integer -> NamedTensor device dtype shape Source # | |
KnownDevice device => Fractional (NamedTensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor Methods (/) :: NamedTensor device dtype shape -> NamedTensor device dtype shape -> NamedTensor device dtype shape Source # recip :: NamedTensor device dtype shape -> NamedTensor device dtype shape Source # fromRational :: Rational -> NamedTensor device dtype shape Source # | |
Show (NamedTensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor | |
(TensorOptions shape' dtype device, shape' ~ ToNats shape) => Default (NamedTensor device dtype shape) Source # | |
Defined in Torch.Typed.Factories Methods def :: NamedTensor device dtype shape Source # | |
Unnamed (NamedTensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor Associated Types type UTShape (NamedTensor device dtype shape) :: [Nat] Source # type UTDevice (NamedTensor device dtype shape) :: (DeviceType, Nat) Source # type UTDType (NamedTensor device dtype shape) :: DType Source # Methods toUnnamed :: forall (device0 :: (DeviceType, Nat)) (dtype0 :: DType) (shape0 :: [Nat]). IsUnnamed (NamedTensor device dtype shape) device0 dtype0 shape0 => NamedTensor device dtype shape -> Tensor device0 dtype0 shape0 Source # fromUnnamed :: forall (device0 :: (DeviceType, Nat)) (dtype0 :: DType) (shape0 :: [Nat]). IsUnnamed (NamedTensor device dtype shape) device0 dtype0 shape0 => Tensor device0 dtype0 shape0 -> NamedTensor device dtype shape Source # toDynamic :: NamedTensor device dtype shape -> Tensor Source # | |
Castable (NamedTensor device dtype shape) ATenTensor Source # | |
Defined in Torch.Typed.Tensor Methods cast :: NamedTensor device dtype shape -> (ATenTensor -> IO r) -> IO r Source # uncast :: ATenTensor -> (NamedTensor device dtype shape -> IO r) -> IO r Source # | |
type UTDType (NamedTensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor | |
type UTDevice (NamedTensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor | |
type UTShape (NamedTensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor |
data TensorListUnfold Source #
Constructors
TensorListUnfold |
Instances
Castable x ATenTensor => Apply TensorListUnfold [ATenTensor] (IO (HJust (x, [ATenTensor]))) Source # | |
Defined in Torch.Typed.Tensor Methods apply :: TensorListUnfold -> [ATenTensor] -> IO (HJust (x, [ATenTensor])) Source # | |
Apply TensorListUnfold [ATenTensor] (IO HNothing) Source # | |
Defined in Torch.Typed.Tensor Methods apply :: TensorListUnfold -> [ATenTensor] -> IO HNothing Source # |
data TensorListFold Source #
Constructors
TensorListFold |
Instances
Castable x ATenTensor => Apply' TensorListFold (x, IO [ATenTensor]) (IO [ATenTensor]) Source # | |
Defined in Torch.Typed.Tensor Methods apply' :: TensorListFold -> (x, IO [ATenTensor]) -> IO [ATenTensor] Source # |
To avoid overlapped instance for (Unnamed t => Castable t D.ATenTensor)
type family MatMulDTypeIsValid (device :: (DeviceType, Nat)) (dtype :: DType) :: Constraint where ... Source #
Equations
MatMulDTypeIsValid '('CPU, 0) dtype = (DTypeIsNotBool '('CPU, 0) dtype, DTypeIsNotHalf '('CPU, 0) dtype) | |
MatMulDTypeIsValid '('CUDA, deviceIndex) dtype = DTypeIsFloatingPoint '('CUDA, deviceIndex) dtype | |
MatMulDTypeIsValid '(deviceType, _) dtype = UnsupportedDTypeForDevice deviceType dtype |
type MatMul shape shape' = CheckMatMul shape shape' (ComputeMatMul (Reverse shape) (Reverse shape')) Source #
type family CheckMatMul (shape :: [Nat]) (shape' :: [Nat]) (result :: Maybe [Nat]) :: [Nat] where ... Source #
type family ComputeMatMul (reversedShape :: [Nat]) (reversedShape' :: [Nat]) :: Maybe [Nat] where ... Source #
Equations
ComputeMatMul (k ': '[]) (k ': '[]) = Just '[] | |
ComputeMatMul (k ': '[]) (m ': (k ': reversedBroadcastShape')) = AppendToMaybe m (ComputeBroadcast '[] reversedBroadcastShape') | |
ComputeMatMul (k ': (n ': reversedBroadcastShape)) (k ': '[]) = AppendToMaybe n (ComputeBroadcast '[] reversedBroadcastShape) | |
ComputeMatMul (k ': (n ': reversedBroadcastShape)) (m ': (k ': reversedBroadcastShape')) = AppendToMaybe m (AppendToMaybe n (ComputeBroadcast reversedBroadcastShape reversedBroadcastShape')) |
type family ComparisonDTypeIsValid (device :: (DeviceType, Nat)) (dtype :: DType) :: Constraint where ... Source #
Equations
ComparisonDTypeIsValid '('CPU, 0) dtype = (DTypeIsNotBool '('CPU, 0) dtype, DTypeIsNotHalf '('CPU, 0) dtype) | |
ComparisonDTypeIsValid '('CUDA, _) dtype = () | |
ComparisonDTypeIsValid '(deviceType, _) dtype = UnsupportedDTypeForDevice deviceType dtype |
type family BasicArithmeticDTypeIsValid (device :: (DeviceType, Nat)) (dtype :: DType) :: Constraint where ... Source #
Equations
BasicArithmeticDTypeIsValid '('CPU, 0) dtype = (DTypeIsNotBool '('CPU, 0) dtype, DTypeIsNotHalf '('CPU, 0) dtype) | |
BasicArithmeticDTypeIsValid '('CUDA, _) dtype = () | |
BasicArithmeticDTypeIsValid '(deviceType, _) dtype = UnsupportedDTypeForDevice deviceType dtype |
type Broadcast shape shape' = CheckBroadcast shape shape' (ComputeBroadcast (Reverse shape) (Reverse shape')) Source #
type family CheckBroadcast (shape :: [Nat]) (shape' :: [Nat]) (result :: Maybe [Nat]) :: [Nat] where ... Source #
type family ComputeBroadcast (reversedShape :: [Nat]) (reversedShape' :: [Nat]) :: Maybe [Nat] where ... Source #
Equations
ComputeBroadcast '[] reversedShape = Just reversedShape | |
ComputeBroadcast reversedShape '[] = Just reversedShape | |
ComputeBroadcast (h ': t) (h ': t2) = AppendToMaybe h (ComputeBroadcast t t2) | |
ComputeBroadcast (h ': t) (1 ': t2) = AppendToMaybe h (ComputeBroadcast t t2) | |
ComputeBroadcast (1 ': t) (h ': t2) = AppendToMaybe h (ComputeBroadcast t t2) | |
ComputeBroadcast _ _ = Nothing |
data SomeDevice where Source #
Constructors
SomeDevice :: forall (device :: (DeviceType, Nat)). KnownDevice device => Proxy device -> SomeDevice |
Constructors
SomeDType :: forall (dtype :: DType). KnownDType dtype => Proxy dtype -> SomeDType |
Constructors
SomeShape :: forall (shape :: [Nat]). KnownShape shape => Proxy shape -> SomeShape |
type family All (pred :: a -> Constraint) (l :: [a]) :: Constraint where ... Source #
class TensorOptions (shape :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)) where Source #
Instances
(KnownDType dtype, KnownDevice device) => TensorOptions ('[] :: [Nat]) dtype device Source # | |
Defined in Torch.Typed.Tensor | |
(KnownNat h, TensorOptions t dtype device) => TensorOptions (h ': t) dtype device Source # | |
Defined in Torch.Typed.Tensor |
type family ComputeItemType (ty :: Type) (shape :: [Nat]) :: Type where ... Source #
Equations
ComputeItemType _ '[] = TypeError (Text "Scalars are not supported") | |
ComputeItemType ty (_ ': '[]) = ty | |
ComputeItemType ty (_ ': (h ': t)) = [ComputeItemType ty (h ': t)] |
type family ComputeHaskellType (dtype :: DType) :: Type where ... Source #
Equations
ComputeHaskellType Bool = Bool | |
ComputeHaskellType Int64 = Int | |
ComputeHaskellType Float = Float | |
ComputeHaskellType Double = Double | |
ComputeHaskellType dtype = TypeError (Text "Unsupported tensor type " :<>: ShowType dtype) |
data UnknownShapeTensor device dtype Source #
Constructors
forall shape. UnknownShapeTensor (Tensor device dtype shape) |
type CUDATensor deviceIndex = Tensor '('CUDA, deviceIndex) Source #
data Tensor (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) where Source #
Constructors
UnsafeMkTensor :: forall device dtype shape. Tensor -> Tensor device dtype shape |
Instances
KnownDType dtype' => HasToDType (dtype' :: DType) (dtype :: DType) (Tensor device dtype shape) (Tensor device dtype' shape) Source # | |
(KnownNat batchSize, KnownDevice device, Applicative m) => Dataset (m :: Type -> Type) (MNIST m device batchSize) Int ((Tensor device 'Float '[batchSize, 784], Tensor device 'Int64 '[batchSize]) :: Type) Source # | |
KnownDevice device' => HasToDevice device' device (Tensor device dtype shape) (Tensor device' dtype shape) Source # | |
(HasGrad (HList parameters) (HList gradients), Castable (HList gradients) [ATenTensor]) => Apply' GradConcurrentlyF (HList parameters, Loss device dtype) (Concurrently (HList gradients)) Source # | |
Defined in Torch.Typed.NN.DataParallel Methods apply' :: GradConcurrentlyF -> (HList parameters, Loss device dtype) -> Concurrently (HList gradients) Source # | |
Apply' MakeIndependent (Tensor device dtype shape) (IO (Parameter device dtype shape)) Source # | |
Defined in Torch.Typed.Parameter | |
Apply' ToParameter (Tensor dev dtype shape) (Parameter dev dtype shape) Source # | |
Defined in Torch.Typed.Optim.CppOptim | |
Apply' ToDependent (Parameter device dtype shape) (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Parameter | |
HasForward Dropout (Tensor device dtype shape) (Tensor device dtype shape) Source # | |
(TensorLike [ComputeItemType (ComputeHaskellType dtype) shape], KnownDevice device, KnownShape shape) => IsList (Maybe (Tensor device dtype shape)) Source # | |
Defined in Torch.Typed.Tensor Methods fromList :: [Item (Maybe (Tensor device dtype shape))] -> Maybe (Tensor device dtype shape) Source # fromListN :: Int -> [Item (Maybe (Tensor device dtype shape))] -> Maybe (Tensor device dtype shape) Source # toList :: Maybe (Tensor device dtype shape) -> [Item (Maybe (Tensor device dtype shape))] Source # | |
Castable [Tensor device dtype shape] (ForeignPtr TensorList) Source # | |
Defined in Torch.Typed.Tensor Methods cast :: [Tensor device dtype shape] -> (ForeignPtr TensorList -> IO r) -> IO r Source # uncast :: ForeignPtr TensorList -> ([Tensor device dtype shape] -> IO r) -> IO r Source # | |
(chunks ~ ListLength devices', tensorChunks ~ (Chunk chunks 0 shape dtype device :: [Type]), Castable (HList tensorChunks) [ATenTensor], devices ~ HReplicateR chunks device, HasToDevices devices' devices tensorChunks gs, KnownNat chunks) => HasScatter (devices' :: [(DeviceType, Nat)]) (device :: (DeviceType, Nat)) (Tensor device dtype shape) (gs :: [Type]) Source # | |
KnownNat n => Castable (Vector n (Tensor device dtype shape)) (ForeignPtr TensorList) Source # | |
Defined in Torch.Typed.Tensor Methods cast :: Vector n (Tensor device dtype shape) -> (ForeignPtr TensorList -> IO r) -> IO r Source # uncast :: ForeignPtr TensorList -> (Vector n (Tensor device dtype shape) -> IO r) -> IO r Source # | |
(chunks ~ ListLength fs, devices ~ GetDevices fs, devices' ~ HReplicateR chunks device', HasToDevices devices' devices fs tensorChunks, '(shape, dtype, device') ~ Cat 0 tensorChunks, Castable (HList tensorChunks) [ATenTensor]) => HasGather (device' :: (DeviceType, Nat)) (devices :: [(DeviceType, Nat)]) (fs :: [Type]) (Tensor device' dtype shape) Source # | |
KnownDevice device => Num (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor Methods (+) :: Tensor device dtype shape -> Tensor device dtype shape -> Tensor device dtype shape Source # (-) :: Tensor device dtype shape -> Tensor device dtype shape -> Tensor device dtype shape Source # (*) :: Tensor device dtype shape -> Tensor device dtype shape -> Tensor device dtype shape Source # negate :: Tensor device dtype shape -> Tensor device dtype shape Source # abs :: Tensor device dtype shape -> Tensor device dtype shape Source # signum :: Tensor device dtype shape -> Tensor device dtype shape Source # fromInteger :: Integer -> Tensor device dtype shape Source # | |
KnownDevice device => Fractional (Tensor device dtype shape) Source # | |
Show (Tensor device dtype shape) Source # | |
TensorOptions shape dtype device => Default (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Factories | |
Parameterized (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Parameter Associated Types type Parameters (Tensor device dtype shape) :: [Type] Source # Methods flattenParameters :: Tensor device dtype shape -> HList (Parameters (Tensor device dtype shape)) Source # replaceParameters :: Tensor device dtype shape -> HList (Parameters (Tensor device dtype shape)) -> Tensor device dtype shape Source # | |
Unnamed (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor Associated Types type UTShape (Tensor device dtype shape) :: [Nat] Source # type UTDevice (Tensor device dtype shape) :: (DeviceType, Nat) Source # Methods toUnnamed :: forall (device0 :: (DeviceType, Nat)) (dtype0 :: DType) (shape0 :: [Nat]). IsUnnamed (Tensor device dtype shape) device0 dtype0 shape0 => Tensor device dtype shape -> Tensor device0 dtype0 shape0 Source # fromUnnamed :: forall (device0 :: (DeviceType, Nat)) (dtype0 :: DType) (shape0 :: [Nat]). IsUnnamed (Tensor device dtype shape) device0 dtype0 shape0 => Tensor device0 dtype0 shape0 -> Tensor device dtype shape Source # | |
Castable (Tensor device dtype shape) ATenTensor Source # | |
Defined in Torch.Typed.Tensor | |
HasGrad (Parameter device dtype shape) (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Autograd | |
(IsSuffixOf normalizedShape shape, KnownShape normalizedShape) => HasForward (LayerNorm normalizedShape dtype device) (Tensor device dtype shape) (Tensor device dtype shape) Source # | |
(1 <= numHeads, embedDim ~ (headDim * numHeads), All KnownNat '[embedDim, numHeads, seqLen, batchSize, headDim], IsSuffixOf '[embedDim] '[batchSize, seqLen, embedDim], KnownDType dtype, StandardFloatingPointDTypeValidation device dtype, MatMulDTypeIsValid device dtype, BasicArithmeticDTypeIsValid device dtype, dtype ~ SumDType dtype, SumDTypeIsValid device dtype, KnownDevice device) => Apply' (FoldLayers batchSize seqLen dtype device) (TransformerLayer embedDim embedDim embedDim numHeads ffnDim dtype device, IO (Tensor device dtype '[batchSize, seqLen, embedDim])) (IO (Tensor device dtype '[batchSize, seqLen, embedDim])) Source # | |
Defined in Torch.Typed.NN.Transformer Methods apply' :: FoldLayers batchSize seqLen dtype device -> (TransformerLayer embedDim embedDim embedDim numHeads ffnDim dtype device, IO (Tensor device dtype '[batchSize, seqLen, embedDim])) -> IO (Tensor device dtype '[batchSize, seqLen, embedDim]) Source # | |
(shape'' ~ MatMul shape '[inputFeatures, outputFeatures], shape' ~ Broadcast shape'' shape'') => HasForward (Linear inputFeatures outputFeatures dtype device) (Tensor device dtype shape) (Tensor device dtype shape') Source # | |
Defined in Torch.Typed.NN.Linear | |
(All KnownNat '[stride, padding, inputChannelSize, outputChannelSize, kernelSize, inputSize, batchSize, outputSize], ConvSideCheck inputSize kernelSize stride padding outputSize) => HasForward (Conv1d inputChannelSize outputChannelSize kernelSize dtype device) (Tensor device dtype '[batchSize, inputChannelSize, inputSize], Proxy stride, Proxy padding) (Tensor device dtype '[batchSize, outputChannelSize, outputSize]) Source # | |
Defined in Torch.Typed.NN.Convolution Methods forward :: Conv1d inputChannelSize outputChannelSize kernelSize dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize], Proxy stride, Proxy padding) -> Tensor device dtype '[batchSize, outputChannelSize, outputSize] Source # forwardStoch :: Conv1d inputChannelSize outputChannelSize kernelSize dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize], Proxy stride, Proxy padding) -> IO (Tensor device dtype '[batchSize, outputChannelSize, outputSize]) Source # | |
(All KnownNat '[stride, padding, inputChannelSize, outputChannelSize, kernelSize, inputSize, batchSize, outputSize], ConvSideCheck inputSize kernelSize stride padding outputSize) => HasForward (ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device) (Tensor device dtype '[batchSize, inputChannelSize, inputSize], Proxy stride, Proxy padding) (Tensor device dtype '[batchSize, outputChannelSize, outputSize]) Source # | |
Defined in Torch.Typed.NN.Convolution Methods forward :: ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize], Proxy stride, Proxy padding) -> Tensor device dtype '[batchSize, outputChannelSize, outputSize] Source # forwardStoch :: ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize], Proxy stride, Proxy padding) -> IO (Tensor device dtype '[batchSize, outputChannelSize, outputSize]) Source # | |
(All KnownNat '[Fst stride, Snd stride, Fst padding, Snd padding, inputChannelSize, outputChannelSize, kernelSize0, kernelSize1, inputSize0, inputSize1, batchSize, outputSize0, outputSize1], ConvSideCheck inputSize0 kernelSize0 (Fst stride) (Fst padding) outputSize0, ConvSideCheck inputSize1 kernelSize1 (Snd stride) (Snd padding) outputSize1) => HasForward (Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1], Proxy stride, Proxy padding) (Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1]) Source # | |
Defined in Torch.Typed.NN.Convolution Methods forward :: Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1], Proxy stride, Proxy padding) -> Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1] Source # forwardStoch :: Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1], Proxy stride, Proxy padding) -> IO (Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1]) Source # | |
(All KnownNat '[Fst stride, Snd stride, Fst padding, Snd padding, inputChannelSize, outputChannelSize, kernelSize0, kernelSize1, inputSize0, inputSize1, batchSize, outputSize0, outputSize1], ConvSideCheck inputSize0 kernelSize0 (Fst stride) (Fst padding) outputSize0, ConvSideCheck inputSize1 kernelSize1 (Snd stride) (Snd padding) outputSize1) => HasForward (ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1], Proxy stride, Proxy padding) (Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1]) Source # | |
Defined in Torch.Typed.NN.Convolution Methods forward :: ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1], Proxy stride, Proxy padding) -> Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1] Source # forwardStoch :: ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1], Proxy stride, Proxy padding) -> IO (Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1]) Source # | |
(KnownMaybeNat paddingIdx, PaddingIdxCheck paddingIdx numEmbeds, shape' ~ Reverse (embedSize ': Reverse shape)) => HasForward (Embedding paddingIdx numEmbeds embedSize embeddingType dtype device) (Tensor device 'Int64 shape) (Tensor device dtype shape') Source # | |
Defined in Torch.Typed.NN.Sparse Methods forward :: Embedding paddingIdx numEmbeds embedSize embeddingType dtype device -> Tensor device 'Int64 shape -> Tensor device dtype shape' Source # forwardStoch :: Embedding paddingIdx numEmbeds embedSize embeddingType dtype device -> Tensor device 'Int64 shape -> IO (Tensor device dtype shape') Source # | |
(All KnownNat '[Fst3 stride, Snd3 stride, Trd3 stride, Fst3 padding, Snd3 padding, Trd3 padding, inputChannelSize, outputChannelSize, kernelSize0, kernelSize1, kernelSize2, inputSize0, inputSize1, inputSize2, batchSize], ConvSideCheck inputSize0 kernelSize0 (Fst3 stride) (Fst3 padding) outputSize0, ConvSideCheck inputSize1 kernelSize1 (Snd3 stride) (Snd3 padding) outputSize1, ConvSideCheck inputSize2 kernelSize2 (Trd3 stride) (Trd3 padding) outputSize2) => HasForward (Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1, inputSize2], Proxy stride, Proxy padding) (Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1, outputSize2]) Source # | |
Defined in Torch.Typed.NN.Convolution Methods forward :: Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1, inputSize2], Proxy stride, Proxy padding) -> Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1, outputSize2] Source # forwardStoch :: Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1, inputSize2], Proxy stride, Proxy padding) -> IO (Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1, outputSize2]) Source # | |
(All KnownNat '[Fst3 stride, Snd3 stride, Trd3 stride, Fst3 padding, Snd3 padding, Trd3 padding, inputChannelSize, outputChannelSize, kernelSize0, kernelSize1, kernelSize2, inputSize0, inputSize1, inputSize2, batchSize], ConvSideCheck inputSize0 kernelSize0 (Fst3 stride) (Fst3 padding) outputSize0, ConvSideCheck inputSize1 kernelSize1 (Snd3 stride) (Snd3 padding) outputSize1, ConvSideCheck inputSize2 kernelSize2 (Trd3 stride) (Trd3 padding) outputSize2) => HasForward (ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1, inputSize2], Proxy stride, Proxy padding) (Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1, outputSize2]) Source # | |
Defined in Torch.Typed.NN.Convolution Methods forward :: ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1, inputSize2], Proxy stride, Proxy padding) -> Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1, outputSize2] Source # forwardStoch :: ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device -> (Tensor device dtype '[batchSize, inputChannelSize, inputSize0, inputSize1, inputSize2], Proxy stride, Proxy padding) -> IO (Tensor device dtype '[batchSize, outputChannelSize, outputSize0, outputSize1, outputSize2]) Source # | |
(All KnownNat '[paddingIdx, embedDim, seqLen, batchSize], (paddingIdx + 1) <= numEmbeds, 1 <= seqLen, HFoldrM IO (FoldLayers batchSize seqLen dtype device) (Tensor device dtype '[batchSize, seqLen, embedDim]) (HReplicateR numAttnLayers (TransformerLayer embedDim embedDim embedDim numHeads ffnDim dtype device)) (Tensor device dtype '[batchSize, seqLen, embedDim]), BasicArithmeticDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device 'Int64, KnownDType dtype, KnownDevice device) => HasForward (TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device) (Tensor device 'Int64 '[batchSize, seqLen]) (Tensor device dtype '[batchSize, seqLen, numEmbeds]) Source # | |
Defined in Torch.Typed.NN.Transformer Methods forward :: TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device -> Tensor device 'Int64 '[batchSize, seqLen] -> Tensor device dtype '[batchSize, seqLen, numEmbeds] Source # forwardStoch :: TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device -> Tensor device 'Int64 '[batchSize, seqLen] -> IO (Tensor device dtype '[batchSize, seqLen, numEmbeds]) Source # | |
type Item (Maybe (Tensor device dtype shape)) Source # | |
Defined in Torch.Typed.Tensor | |
type Parameters (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Parameter | |
type UTDType (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor | |
type UTDevice (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor | |
type UTShape (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor |
type family IsUnnamed t (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) :: Constraint where ... Source #
class Unnamed t where Source #
Methods
toUnnamed :: forall device dtype shape. IsUnnamed t device dtype shape => t -> Tensor device dtype shape Source #
fromUnnamed :: forall device dtype shape. IsUnnamed t device dtype shape => Tensor device dtype shape -> t Source #
Instances
Unnamed (NamedTensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor Associated Types type UTShape (NamedTensor device dtype shape) :: [Nat] Source # type UTDevice (NamedTensor device dtype shape) :: (DeviceType, Nat) Source # type UTDType (NamedTensor device dtype shape) :: DType Source # Methods toUnnamed :: forall (device0 :: (DeviceType, Nat)) (dtype0 :: DType) (shape0 :: [Nat]). IsUnnamed (NamedTensor device dtype shape) device0 dtype0 shape0 => NamedTensor device dtype shape -> Tensor device0 dtype0 shape0 Source # fromUnnamed :: forall (device0 :: (DeviceType, Nat)) (dtype0 :: DType) (shape0 :: [Nat]). IsUnnamed (NamedTensor device dtype shape) device0 dtype0 shape0 => Tensor device0 dtype0 shape0 -> NamedTensor device dtype shape Source # toDynamic :: NamedTensor device dtype shape -> Tensor Source # | |
Unnamed (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor Associated Types type UTShape (Tensor device dtype shape) :: [Nat] Source # type UTDevice (Tensor device dtype shape) :: (DeviceType, Nat) Source # Methods toUnnamed :: forall (device0 :: (DeviceType, Nat)) (dtype0 :: DType) (shape0 :: [Nat]). IsUnnamed (Tensor device dtype shape) device0 dtype0 shape0 => Tensor device dtype shape -> Tensor device0 dtype0 shape0 Source # fromUnnamed :: forall (device0 :: (DeviceType, Nat)) (dtype0 :: DType) (shape0 :: [Nat]). IsUnnamed (Tensor device dtype shape) device0 dtype0 shape0 => Tensor device0 dtype0 shape0 -> Tensor device dtype shape Source # |
type family ToNat (shape :: Size) :: Nat where ... Source #
Equations
ToNat (S1 ('MetaSel _ _ _ _) f) = ToNat f | |
ToNat (D1 _ f) = ToNat f | |
ToNat (C1 _ f) = ToNat f | |
ToNat (l :*: r) = ToNat l + ToNat r | |
ToNat (l :+: r) = If (ToNat l <=? ToNat r) (ToNat r) (ToNat l) | |
ToNat (K1 R (Vector n _)) = n | |
ToNat (K1 _ _) = 1 | |
ToNat U1 = 1 | |
ToNat (Vector n) = n | |
ToNat a = ToNat (Rep (a ())) |
class KnownDevice (device :: (DeviceType, Nat)) where Source #
Instances
KnownNat n => KnownDevice '('CPU, n) Source # | |
Defined in Torch.Typed.Tensor | |
KnownNat n => KnownDevice '('CUDA, n) Source # | |
Defined in Torch.Typed.Tensor |
type family ComputeDType (dtype' :: dtype) :: DType where ... Source #
Equations
ComputeDType Bool = Bool | |
ComputeDType Bool = Bool | |
ComputeDType UInt8 = UInt8 | |
ComputeDType Int8 = Int8 | |
ComputeDType Int16 = Int16 | |
ComputeDType Int32 = Int32 | |
ComputeDType Int = Int64 | |
ComputeDType Int64 = Int64 | |
ComputeDType Float = Float | |
ComputeDType Float = Float | |
ComputeDType Double = Double | |
ComputeDType Double = Double | |
ComputeDType dtype' = TypeError (Text "Unsupported tensor type " :<>: ShowType dtype') |
class KnownDType (dtype :: DType) where Source #
Instances
KnownDType 'Bool Source # | |
Defined in Torch.Typed.Tensor | |
KnownDType 'Double Source # | |
Defined in Torch.Typed.Tensor | |
KnownDType 'Float Source # | |
Defined in Torch.Typed.Tensor | |
KnownDType 'Half Source # | |
Defined in Torch.Typed.Tensor | |
KnownDType 'Int16 Source # | |
Defined in Torch.Typed.Tensor | |
KnownDType 'Int32 Source # | |
Defined in Torch.Typed.Tensor | |
KnownDType 'Int64 Source # | |
Defined in Torch.Typed.Tensor | |
KnownDType 'Int8 Source # | |
Defined in Torch.Typed.Tensor | |
KnownDType 'UInt8 Source # | |
Defined in Torch.Typed.Tensor |
class KnownShape (shape :: [Nat]) where Source #
Instances
KnownShape ('[] :: [Nat]) Source # | |
Defined in Torch.Typed.Tensor | |
(KnownNat h, KnownShape t) => KnownShape (h ': t) Source # | |
Defined in Torch.Typed.Tensor |
getFiniteI :: Finite n -> Int Source #
someDevice :: Device -> SomeDevice Source #
withTensor :: Tensor -> (forall shape dtype device. (KnownDevice device, KnownDType dtype, KnownShape shape) => Tensor device dtype shape -> r) -> r Source #
withTensorShape :: forall device dtype r. (KnownDevice device, KnownDType dtype) => Tensor -> (forall shape. KnownShape shape => Tensor device dtype shape -> r) -> r Source #
add :: forall shape'' shape shape' dtype dtype' dtype'' device. (dtype'' ~ DTypePromotion dtype dtype', shape'' ~ Broadcast shape shape', BasicArithmeticDTypeIsValid device dtype, BasicArithmeticDTypeIsValid device dtype', BasicArithmeticDTypeIsValid device dtype'') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device dtype'' shape'' Source #
sub :: forall shape'' shape shape' dtype dtype' dtype'' device. (dtype'' ~ DTypePromotion dtype dtype', shape'' ~ Broadcast shape shape', BasicArithmeticDTypeIsValid device dtype, BasicArithmeticDTypeIsValid device dtype', BasicArithmeticDTypeIsValid device dtype'') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device dtype'' shape'' Source #
mul :: forall shape'' shape shape' dtype dtype' dtype'' device. (dtype'' ~ DTypePromotion dtype dtype', shape'' ~ Broadcast shape shape', BasicArithmeticDTypeIsValid device dtype, BasicArithmeticDTypeIsValid device dtype', BasicArithmeticDTypeIsValid device dtype'') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device dtype'' shape'' Source #
div :: forall shape'' shape shape' dtype dtype' dtype'' device. (dtype'' ~ DTypePromotion dtype dtype', shape'' ~ Broadcast shape shape', BasicArithmeticDTypeIsValid device dtype, BasicArithmeticDTypeIsValid device dtype', BasicArithmeticDTypeIsValid device dtype'') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device dtype'' shape'' Source #
gt :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
lt :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
ge :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
le :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
eq :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
ne :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
(>.) :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
(<.) :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
(>=.) :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
(<=.) :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
(==.) :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
(/=.) :: forall shape'' shape shape' dtype dtype' device. (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
matmul :: forall shape'' shape shape' dtype device. (shape'' ~ MatMul shape shape', MatMulDTypeIsValid device dtype) => Tensor device dtype shape -> Tensor device dtype shape' -> Tensor device dtype shape'' Source #
matrix multiplication See https://pytorch.org/docs/stable/torch.html#torch.matmul.
select :: forall dim idx shape' shape dtype device. (KnownNat dim, KnownNat idx, InRange shape dim idx, shape' ~ Remove shape dim) => Tensor device dtype shape -> Tensor device dtype shape' Source #
selectIdx :: forall dim n shape' shape dtype device. (KnownNat dim, n ~ Index shape dim, shape' ~ Remove shape dim) => Tensor device dtype shape -> Finite n -> Tensor device dtype shape' Source #
reshape :: forall shape' shape dtype device. (KnownShape shape', Numel shape ~ Numel shape') => Tensor device dtype shape -> Tensor device dtype shape' Source #
reshape
>>> t :: CPUTensor 'D.Int64 '[2,3,4] = fromJust [[[111,112,113,114],[121,122,123,124],[131,132,133,134]],[[211,212,213,214],[221,222,223,224],[231,232,233,234]]]
>>> t' = reshape '[24] t
>>> toList . Just $ t'
[111,112,113,114,121,122,123,124,131,132,133,134,211,212,213,214,221,222,223,224,231,232,233,234]
>>> toList . Just $ reshape
'[2,3,4] t'
[[[111,112,113,114],[121,122,123,124],[131,132,133,134]],[[211,212,213,214],[221,222,223,224],[231,232,233,234]]]
toCPU :: forall device shape dtype. Tensor device dtype shape -> CPUTensor dtype shape Source #
move tensor to CPU TODO: can this fail?
toCUDA :: forall device' device shape dtype. Tensor device dtype shape -> CUDATensor 0 dtype shape Source #
move tensor to the first CUDA device TODO: what if this fails?
dim :: forall device dtype shape t. (TensorOptions shape dtype device, IsUnnamed t device dtype shape) => t -> Int Source #
returns tensor dimension uses compile-time information only
shape :: forall device dtype shape t. (TensorOptions shape dtype device, IsUnnamed t device dtype shape) => t -> [Int] Source #
returns tensor shape as list uses compile-time information only
dtype :: forall device dtype shape t. (TensorOptions shape dtype device, IsUnnamed t device dtype shape) => t -> DType Source #
returns tensor data type uses compile-time information only
device :: forall device dtype shape t. (TensorOptions shape dtype device, IsUnnamed t device dtype shape) => t -> Device Source #
returns tensor device uses compile-time information only
module Torch.Typed.Vision
Constructors
Device | |
Fields
|
Instances
Show Device Source # | |
Eq Device Source # | |
Ord Device Source # | |
Show (TVar (Either (Word64, Device) (ForeignPtr Generator))) Source # | |
data DeviceType Source #
Instances
Show DeviceType Source # | |
Defined in Torch.Device | |
Eq DeviceType Source # | |
Defined in Torch.Device Methods (==) :: DeviceType -> DeviceType -> Bool Source # (/=) :: DeviceType -> DeviceType -> Bool Source # | |
Ord DeviceType Source # | |
Defined in Torch.Device Methods compare :: DeviceType -> DeviceType -> Ordering Source # (<) :: DeviceType -> DeviceType -> Bool Source # (<=) :: DeviceType -> DeviceType -> Bool Source # (>) :: DeviceType -> DeviceType -> Bool Source # (>=) :: DeviceType -> DeviceType -> Bool Source # max :: DeviceType -> DeviceType -> DeviceType Source # min :: DeviceType -> DeviceType -> DeviceType Source # | |
Castable DeviceType DeviceType Source # | |
Defined in Torch.Device Methods cast :: DeviceType -> (DeviceType0 -> IO r) -> IO r Source # uncast :: DeviceType0 -> (DeviceType -> IO r) -> IO r Source # | |
HasToDevice device' device (HList xs) (HList ys) => ReduceGradients device' '[device] ('[HList xs] :: [Type]) (ys :: [k]) Source # | |
Defined in Torch.Typed.NN.DataParallel | |
(HasToDevice device' device (HList xs) (HList ys), ReduceGradients device' devices xxs ys, HZipWith SumF ys ys ys, 1 <= ListLength xxs) => ReduceGradients device' (device ': devices) (HList xs ': xxs :: [Type]) (ys :: [k]) Source # | |
Defined in Torch.Typed.NN.DataParallel | |
HasReplicate ('[] :: [(DeviceType, Nat)]) device f ('[] :: [Type]) Source # | |
Defined in Torch.Typed.Device | |
HasToDevices ('[] :: [(DeviceType, Nat)]) ('[] :: [(DeviceType, Nat)]) ('[] :: [Type]) ('[] :: [Type]) Source # | |
(chunks ~ ListLength devices', tensorChunks ~ (Chunk chunks 0 shape dtype device :: [Type]), Castable (HList tensorChunks) [ATenTensor], devices ~ HReplicateR chunks device, HasToDevices devices' devices tensorChunks gs, KnownNat chunks) => HasScatter (devices' :: [(DeviceType, Nat)]) (device :: (DeviceType, Nat)) (Tensor device dtype shape) (gs :: [Type]) Source # | |
(HZipWithM Concurrently GradConcurrentlyF parameters losses gradients', ReduceGradients device' devices gradients' gradients) => HasGradConcurrently (device' :: (DeviceType, Nat)) (devices :: [(DeviceType, Nat)]) (parameters :: [k1]) (losses :: [k1]) (gradients :: [k2]) Source # | |
Defined in Torch.Typed.NN.DataParallel Methods gradConcurrently :: HList parameters -> HList losses -> Concurrently (HList gradients) Source # | |
(chunks ~ ListLength fs, devices ~ GetDevices fs, devices' ~ HReplicateR chunks device', HasToDevices devices' devices fs tensorChunks, '(shape, dtype, device') ~ Cat 0 tensorChunks, Castable (HList tensorChunks) [ATenTensor]) => HasGather (device' :: (DeviceType, Nat)) (devices :: [(DeviceType, Nat)]) (fs :: [Type]) (Tensor device' dtype shape) Source # | |
(HasReplicate devices' device f gs, HasToDevice device' device f g) => HasReplicate (device' ': devices') device f (g ': gs) Source # | |
Defined in Torch.Typed.Device | |
(HasToDevices devices' devices fs gs, HasToDevice device' device f g) => HasToDevices (device' ': devices') (device ': devices) (f ': fs) (g ': gs) Source # | |
KnownNat n => KnownDevice '('CPU, n) Source # | |
Defined in Torch.Typed.Tensor | |
KnownNat n => KnownDevice '('CUDA, n) Source # | |
Defined in Torch.Typed.Tensor |
Constructors
Bool | Bool |
UInt8 | Byte |
Int8 | Char |
Int16 | Short |
Int32 | Int |
Int64 | Long |
Half | Half |
Float | Float |
Double | Double |
ComplexHalf | ComplexHalf |
ComplexFloat | ComplexFloat |
ComplexDouble | ComplexDouble |
QInt8 | QInt8 |
QUInt8 | QUInt8 |
QInt32 | QInt32 |
BFloat16 | BFloat16 |
Instances
class Castable a (ForeignPtr Scalar) => Scalar a Source #
Instances
Scalar Bool Source # | |
Defined in Torch.Scalar | |
Scalar Double Source # | |
Defined in Torch.Scalar | |
Scalar Float Source # | |
Defined in Torch.Scalar | |
Scalar Int Source # | |
Defined in Torch.Scalar |
Constructors
ReduceNone | |
ReduceMean | |
ReduceSum |
Instances
Show Reduction Source # | |
Eq Reduction Source # | |
KnownReduction 'ReduceMean Source # | |
Defined in Torch.Typed.Functional Methods reductionVal :: Int Source # | |
KnownReduction 'ReduceNone Source # | |
Defined in Torch.Typed.Functional Methods reductionVal :: Int Source # | |
KnownReduction 'ReduceSum Source # | |
Defined in Torch.Typed.Functional Methods reductionVal :: Int Source # | |
Castable Reduction Int64 Source # | |