Safe Haskell | None |
---|---|
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
- newtype Parameter (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) = UnsafeMkParameter IndependentTensor
- class Randomizable spec f | spec -> f where
- makeIndependent :: forall (shape :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)). Tensor device dtype shape -> IO (Parameter device dtype shape)
- toDependent :: forall (shape :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)). Parameter device dtype shape -> Tensor device dtype shape
- class Parameterized f where
- type Parameters f :: [Type]
- flattenParameters :: f -> HList (Parameters f)
- replaceParameters :: f -> HList (Parameters f) -> f
- class GParameterized (f :: Type -> Type) where
- type GParameters (f :: Type -> Type) :: [Type]
- gFlattenParameters :: f a -> HList (GParameters f)
- gReplaceParameters :: f a -> HList (GParameters f) -> f a
- untypeParam :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]). Parameter device dtype shape -> Parameter
- data ToDependent = ToDependent
- data MakeIndependent = MakeIndependent
- type family Parameters f :: [Type]
- type family GParameters (f :: Type -> Type) :: [Type]
- module Torch.Typed.Serialize
- div :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (dtype'' :: DType) (device :: (DeviceType, Nat)). (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''
- type family All (pred :: a -> Constraint) (l :: [a]) where ...
- toBool :: forall (device :: (DeviceType, Nat)). Tensor device 'Bool ('[] :: [Nat]) -> Bool
- type Size = Type -> Type
- eq :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- add :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (dtype'' :: DType) (device :: (DeviceType, Nat)). (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'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (dtype'' :: DType) (device :: (DeviceType, Nat)). (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''
- select :: forall (dim :: Nat) (idx :: Nat) (shape' :: [Nat]) (shape :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)). (KnownNat dim, KnownNat idx, InRange shape dim idx, shape' ~ Remove shape dim) => Tensor device dtype shape -> Tensor device dtype shape'
- (<.) :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- mul :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (dtype'' :: DType) (device :: (DeviceType, Nat)). (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''
- data Tensor (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) where
- UnsafeMkTensor :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]). Tensor -> Tensor device dtype shape
- class TensorOptions (shape :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)) where
- dtype :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) t. (TensorOptions shape dtype device, IsUnnamed t device dtype shape) => t -> DType
- device :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) t. (TensorOptions shape dtype device, IsUnnamed t device dtype shape) => t -> Device
- data NamedTensor (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: Shape) where
- FromTensor :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: Shape) (shape1 :: [Nat]). shape1 ~ ToNats shape => Tensor device dtype shape1 -> NamedTensor device dtype shape
- lt :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- gt :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- class Unnamed t where
- type UTShape t :: [Nat]
- type UTDevice t :: (DeviceType, Nat)
- type UTDType t :: DType
- toUnnamed :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]). IsUnnamed t device dtype shape => t -> Tensor device dtype shape
- fromUnnamed :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]). IsUnnamed t device dtype shape => Tensor device dtype shape -> t
- toDynamic :: t -> Tensor
- dim :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) t. (TensorOptions shape dtype device, IsUnnamed t device dtype shape) => t -> Int
- shape :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) t. (TensorOptions shape dtype device, IsUnnamed t device dtype shape) => t -> [Int]
- withTensor :: Tensor -> (forall (shape :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)). (KnownDevice device, KnownDType dtype, KnownShape shape) => Tensor device dtype shape -> r) -> r
- toDouble :: forall (device :: (DeviceType, Nat)). Tensor device 'Double ('[] :: [Nat]) -> Double
- toInt :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]). Tensor device dtype shape -> Int
- reshape :: forall (shape' :: [Nat]) (shape :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)). (KnownShape shape', Numel shape ~ Numel shape') => Tensor device dtype shape -> Tensor device dtype shape'
- toSparse :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]). Tensor device dtype shape -> Tensor device dtype shape
- toDense :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]). Tensor device dtype shape -> Tensor device dtype shape
- toCPU :: forall (device :: (DeviceType, Nat)) (shape :: [Nat]) (dtype :: DType). Tensor device dtype shape -> CPUTensor dtype shape
- toCUDA :: forall {k} (device' :: k) (device :: (DeviceType, Nat)) (shape :: [Nat]) (dtype :: DType). Tensor device dtype shape -> CUDATensor 0 dtype shape
- toMPS :: forall {k} (device' :: k) (device :: (DeviceType, Nat)) (shape :: [Nat]) (dtype :: DType). Tensor device dtype shape -> MPSTensor 0 dtype shape
- matmul :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)). (shape'' ~ MatMul shape shape', MatMulDTypeIsValid device dtype) => Tensor device dtype shape -> Tensor device dtype shape' -> Tensor device dtype shape''
- ne :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (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'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (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'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- (>.) :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- (>=.) :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- (<=.) :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- (==.) :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- (/=.) :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape''
- type Shape = [Type -> Type]
- class KnownShape (shape :: [Nat]) where
- getFiniteI :: forall (n :: Nat). Finite n -> Int
- class KnownDType (dtype :: DType) where
- type family ComputeDType (dtype' :: dtype) :: DType where ...
- class KnownDevice (device :: (DeviceType, Nat)) where
- type family ToNat (shape :: Size) :: Nat where ...
- type family ToNats (shape :: Shape) :: [Nat] where ...
- type family FromNat (shape :: Nat) :: Size where ...
- type family FromNats (shape :: [Nat]) :: Shape where ...
- type family UTShape t :: [Nat]
- type family UTDevice t :: (DeviceType, Nat)
- type family UTDType t :: DType
- type family IsUnnamed t (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) where ...
- type CPUTensor = Tensor '('CPU, 0)
- type CUDATensor (deviceIndex :: Nat) = Tensor '('CUDA, deviceIndex)
- type MPSTensor (deviceIndex :: k) = Tensor '('MPS, 0)
- data UnknownShapeTensor (device :: (DeviceType, Nat)) (dtype :: DType) = UnknownShapeTensor (Tensor device dtype shape)
- type family ComputeHaskellType (dtype :: DType) where ...
- type family ComputeItemType ty (shape :: [Nat]) where ...
- data SomeShape where
- SomeShape :: forall (shape :: [Nat]). KnownShape shape => Proxy shape -> SomeShape
- someShape :: [Int] -> SomeShape
- data SomeDType where
- SomeDType :: forall (dtype :: DType). KnownDType dtype => Proxy dtype -> SomeDType
- someDType :: DType -> SomeDType
- data SomeDevice where
- SomeDevice :: forall (device :: (DeviceType, Nat)). KnownDevice device => Proxy device -> SomeDevice
- someDevice :: Device -> SomeDevice
- withTensorShape :: forall (device :: (DeviceType, Nat)) (dtype :: DType) r. (KnownDevice device, KnownDType dtype) => Tensor -> (forall (shape :: [Nat]). KnownShape shape => Tensor device dtype shape -> r) -> r
- type family ComputeBroadcast (reversedShape :: [Nat]) (reversedShape' :: [Nat]) :: Maybe [Nat] where ...
- type family CheckBroadcast (shape :: [Nat]) (shape' :: [Nat]) (result :: Maybe [Nat]) :: [Nat] where ...
- type Broadcast (shape :: [Nat]) (shape' :: [Nat]) = CheckBroadcast shape shape' (ComputeBroadcast (Reverse shape) (Reverse shape'))
- type family BasicArithmeticDTypeIsValid (device :: (DeviceType, Nat)) (dtype :: DType) where ...
- type family ComparisonDTypeIsValid (device :: (DeviceType, Nat)) (dtype :: DType) where ...
- type family ComputeMatMul (reversedShape :: [Nat]) (reversedShape' :: [Nat]) :: Maybe [Nat] where ...
- type family CheckMatMul (shape :: [Nat]) (shape' :: [Nat]) (result :: Maybe [Nat]) :: [Nat] where ...
- type MatMul (shape :: [Nat]) (shape' :: [Nat]) = CheckMatMul shape shape' (ComputeMatMul (Reverse shape) (Reverse shape'))
- type family MatMulDTypeIsValid (device :: (DeviceType, Nat)) (dtype :: DType) where ...
- selectIdx :: forall (dim :: Nat) (n :: Nat) (shape' :: [Nat]) (shape :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)). (KnownNat dim, n ~ Index shape dim, shape' ~ Remove shape dim) => Tensor device dtype shape -> Finite n -> Tensor device dtype shape'
- type family Numel (shape :: [Nat]) :: Nat where ...
- newtype Wrap a = Wrap {
- unWrap :: a
- data TensorListFold = TensorListFold
- data TensorListUnfold = TensorListUnfold
- type family ReplaceDevice'' (tensor :: t) (device :: (DeviceType, Nat)) :: t where ...
- type family ReplaceDType'' (tensor :: t) (dtype :: DType) :: t where ...
- toFloat :: forall (device :: (DeviceType, Nat)). Tensor device 'Float ('[] :: [Nat]) -> Float
- type family ToDType a :: DType where ...
- type family ToShape a :: Shape where ...
- type family FindDim (a :: Size) (shape :: Shape) :: Nat where ...
- 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
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
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 |
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 # |
makeIndependent :: forall (shape :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)). Tensor device dtype shape -> IO (Parameter device dtype shape) Source #
toDependent :: forall (shape :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)). Parameter device dtype shape -> Tensor device dtype shape Source #
class Parameterized f 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
Methods flattenParameters :: Dropout -> HList (Parameters Dropout) Source # replaceParameters :: Dropout -> HList (Parameters Dropout) -> Dropout Source # | |||||
Parameterized GD Source # | |||||
Defined in Torch.Typed.Optim Associated Types
Methods flattenParameters :: GD -> HList (Parameters GD) Source # replaceParameters :: GD -> HList (Parameters GD) -> GD Source # | |||||
Parameterized Double Source # | |||||
Defined in Torch.Typed.Parameter Associated Types
Methods flattenParameters :: Double -> HList (Parameters Double) Source # replaceParameters :: Double -> HList (Parameters Double) -> Double Source # | |||||
Parameterized Float Source # | |||||
Defined in Torch.Typed.Parameter Associated Types
Methods flattenParameters :: Float -> HList (Parameters Float) Source # replaceParameters :: Float -> HList (Parameters Float) -> Float Source # | |||||
Parameterized Int Source # | |||||
Defined in Torch.Typed.Parameter Associated Types
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
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
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
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
Methods flattenParameters :: HList ('[] :: [k]) -> HList (Parameters (HList ('[] :: [k]))) Source # replaceParameters :: HList ('[] :: [k]) -> HList (Parameters (HList ('[] :: [k]))) -> HList ('[] :: [k]) Source # | |||||
Parameterized (LayerNorm normalizedShape dtype device) Source # | |||||
Defined in Torch.Typed.NN.Normalization Associated Types
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 # |
class GParameterized (f :: Type -> Type) where Source #
Methods
gFlattenParameters :: f a -> HList (GParameters f) Source #
gReplaceParameters :: f a -> HList (GParameters f) -> f a Source #
Instances
untypeParam :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]). Parameter device dtype shape -> Parameter Source #
data ToDependent Source #
Constructors
ToDependent |
Instances
Apply' ToDependent (Parameter device dtype shape) (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Parameter |
data MakeIndependent Source #
Constructors
MakeIndependent |
Instances
Apply' MakeIndependent (Tensor device dtype shape) (IO (Parameter device dtype shape)) Source # | |
Defined in Torch.Typed.Parameter |
type family Parameters f :: [Type] Source #
Instances
type Parameters Dropout Source # | |
Defined in Torch.Typed.NN.Dropout | |
type Parameters GD Source # | |
Defined in Torch.Typed.Optim | |
type Parameters Double Source # | |
Defined in Torch.Typed.Parameter | |
type Parameters Float Source # | |
Defined in Torch.Typed.Parameter | |
type Parameters Int Source # | |
Defined in Torch.Typed.Parameter | |
type Parameters (Adam momenta) Source # | |
Defined in Torch.Typed.Optim | |
type Parameters (GDM momenta) Source # | |
Defined in Torch.Typed.Optim | |
type Parameters (HList (f ': fs)) Source # | |
Defined in Torch.Typed.Parameter | |
type Parameters (HList ('[] :: [k])) Source # | |
Defined in Torch.Typed.Parameter | |
type Parameters (LayerNorm normalizedShape dtype device) Source # | |
Defined in Torch.Typed.NN.Normalization type Parameters (LayerNorm normalizedShape dtype device) = GParameters (Rep (LayerNorm normalizedShape dtype device)) | |
type Parameters (Parameter device dtype shape) Source # | |
Defined in Torch.Typed.Parameter | |
type Parameters (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Parameter | |
type Parameters (Linear inputFeatures outputFeatures dtype device) Source # | |
Defined in Torch.Typed.NN.Linear type Parameters (Linear inputFeatures outputFeatures dtype device) = GParameters (Rep (Linear inputFeatures outputFeatures dtype device)) | |
type Parameters (GRUCell inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.GRU type Parameters (GRUCell inputDim hiddenDim dtype device) = GParameters (Rep (GRUCell inputDim hiddenDim dtype device)) | |
type Parameters (LSTMCell inputDim hiddenDim dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.Cell.LSTM type Parameters (LSTMCell inputDim hiddenDim dtype device) = GParameters (Rep (LSTMCell inputDim hiddenDim dtype device)) | |
type Parameters (TransformerMLP embedDim ffnDim dtype device) Source # | |
Defined in Torch.Typed.NN.Transformer type Parameters (TransformerMLP embedDim ffnDim dtype device) = GParameters (Rep (TransformerMLP embedDim ffnDim dtype device)) | |
type Parameters (Conv1d inputChannelSize outputChannelSize kernelSize dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution type Parameters (Conv1d inputChannelSize outputChannelSize kernelSize dtype device) = GParameters (Rep (Conv1d inputChannelSize outputChannelSize kernelSize dtype device)) | |
type Parameters (ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution type Parameters (ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device) = GParameters (Rep (ConvTranspose1d inputChannelSize outputChannelSize kernelSize dtype device)) | |
type Parameters (GRULayer inputSize hiddenSize 'Bidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU type Parameters (GRULayer inputSize hiddenSize 'Bidirectional dtype device) = '[Parameter device dtype (GRUWIShape hiddenSize inputSize), Parameter device dtype (GRUWHShape hiddenSize inputSize), Parameter device dtype (GRUBIShape hiddenSize inputSize), Parameter device dtype (GRUBHShape hiddenSize inputSize), Parameter device dtype (GRUWIShape hiddenSize inputSize), Parameter device dtype (GRUWHShape hiddenSize inputSize), Parameter device dtype (GRUBIShape hiddenSize inputSize), Parameter device dtype (GRUBHShape hiddenSize inputSize)] | |
type Parameters (GRULayer inputSize hiddenSize 'Unidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU type Parameters (GRULayer inputSize hiddenSize 'Unidirectional dtype device) = '[Parameter device dtype (GRUWIShape hiddenSize inputSize), Parameter device dtype (GRUWHShape hiddenSize inputSize), Parameter device dtype (GRUBIShape hiddenSize inputSize), Parameter device dtype (GRUBHShape hiddenSize inputSize)] | |
type Parameters (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTMLayer inputSize hiddenSize 'Bidirectional dtype device) = '[Parameter device dtype (LSTMWIShape hiddenSize inputSize), Parameter device dtype (LSTMWHShape hiddenSize inputSize), Parameter device dtype (LSTMBIShape hiddenSize inputSize), Parameter device dtype (LSTMBHShape hiddenSize inputSize), Parameter device dtype (LSTMWIShape hiddenSize inputSize), Parameter device dtype (LSTMWHShape hiddenSize inputSize), Parameter device dtype (LSTMBIShape hiddenSize inputSize), Parameter device dtype (LSTMBHShape hiddenSize inputSize)] | |
type Parameters (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTMLayer inputSize hiddenSize 'Unidirectional dtype device) = '[Parameter device dtype (LSTMWIShape hiddenSize inputSize), Parameter device dtype (LSTMWHShape hiddenSize inputSize), Parameter device dtype (LSTMBIShape hiddenSize inputSize), Parameter device dtype (LSTMBHShape hiddenSize inputSize)] | |
type Parameters (Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution type Parameters (Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) = GParameters (Rep (Conv2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device)) | |
type Parameters (ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution type Parameters (ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device) = GParameters (Rep (ConvTranspose2d inputChannelSize outputChannelSize kernelSize0 kernelSize1 dtype device)) | |
type Parameters (GRU inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU type Parameters (GRU inputSize hiddenSize numLayers directionality dtype device) = GParameters (Rep (GRU inputSize hiddenSize numLayers directionality dtype device)) | |
type Parameters (GRULayerStack inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU type Parameters (GRULayerStack inputSize hiddenSize numLayers directionality dtype device) = GRULayerStackParameters (2 <=? numLayers) inputSize hiddenSize numLayers directionality dtype device | |
type Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTM inputSize hiddenSize numLayers directionality dtype device) = GParameters (Rep (LSTM inputSize hiddenSize numLayers directionality dtype device)) | |
type Parameters (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTMLayerStack inputSize hiddenSize numLayers directionality dtype device) = LSTMLayerStackParameters (2 <=? numLayers) inputSize hiddenSize numLayers directionality dtype device | |
type Parameters (Embedding paddingIdx numEmbeds embedSize 'Constant dtype device) Source # | |
Defined in Torch.Typed.NN.Sparse type Parameters (Embedding paddingIdx numEmbeds embedSize 'Constant dtype device) = GParameters (Rep (Embedding paddingIdx numEmbeds embedSize 'Constant dtype device)) | |
type Parameters (Embedding paddingIdx numEmbeds embedSize 'Learned dtype device) Source # | |
Defined in Torch.Typed.NN.Sparse type Parameters (Embedding paddingIdx numEmbeds embedSize 'Learned dtype device) = GParameters (Rep (Embedding paddingIdx numEmbeds embedSize 'Learned dtype device)) | |
type Parameters (MultiheadAttention embedDim kEmbedDim vEmbedDim numHeads dtype device) Source # | |
Defined in Torch.Typed.NN.Transformer type Parameters (MultiheadAttention embedDim kEmbedDim vEmbedDim numHeads dtype device) = GParameters (Rep (MultiheadAttention embedDim kEmbedDim vEmbedDim numHeads dtype device)) | |
type Parameters (Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution type Parameters (Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) = GParameters (Rep (Conv3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device)) | |
type Parameters (ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) Source # | |
Defined in Torch.Typed.NN.Convolution type Parameters (ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device) = GParameters (Rep (ConvTranspose3d inputChannelSize outputChannelSize kernelSize0 kernelSize1 kernelSize2 dtype device)) | |
type Parameters (GRUWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU type Parameters (GRUWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) = GParameters (Rep (GRUWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device)) | |
type Parameters (GRUWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.GRU type Parameters (GRUWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) = GParameters (Rep (GRUWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device)) | |
type Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device) = GParameters (Rep (LSTMWithInit inputSize hiddenSize numLayers directionality 'ConstantInitialization dtype device)) | |
type Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) Source # | |
Defined in Torch.Typed.NN.Recurrent.LSTM type Parameters (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device) = GParameters (Rep (LSTMWithInit inputSize hiddenSize numLayers directionality 'LearnedInitialization dtype device)) | |
type Parameters (TransformerLayer embedDim kEmbedDim vEmbedDim numHeads ffnDim dtype device) Source # | |
Defined in Torch.Typed.NN.Transformer type Parameters (TransformerLayer embedDim kEmbedDim vEmbedDim numHeads ffnDim dtype device) = GParameters (Rep (TransformerLayer embedDim kEmbedDim vEmbedDim numHeads ffnDim dtype device)) | |
type Parameters (TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device) Source # | |
Defined in Torch.Typed.NN.Transformer type Parameters (TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device) = GParameters (Rep (TransformerLM numAttnLayers numHeads ffnDim paddingIdx numEmbeds embedDim dtype device)) |
type family GParameters (f :: Type -> Type) :: [Type] Source #
Instances
type GParameters (U1 :: Type -> Type) Source # | |
Defined in Torch.Typed.Parameter | |
type GParameters (l :*: r) Source # | |
Defined in Torch.Typed.Parameter | |
type GParameters (K1 i f :: Type -> Type) Source # | |
Defined in Torch.Typed.Parameter | |
type GParameters (M1 i t f) Source # | |
Defined in Torch.Typed.Parameter |
module Torch.Typed.Serialize
div :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (dtype'' :: DType) (device :: (DeviceType, Nat)). (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 #
type family All (pred :: a -> Constraint) (l :: [a]) where ... Source #
Equations
All (_1 :: a -> Constraint) ('[] :: [a]) = () | |
All (pred :: a -> Constraint) (h ': t :: [a]) = (pred h, All pred t) |
eq :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
add :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (dtype'' :: DType) (device :: (DeviceType, Nat)). (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'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (dtype'' :: DType) (device :: (DeviceType, Nat)). (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 #
select :: forall (dim :: Nat) (idx :: Nat) (shape' :: [Nat]) (shape :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)). (KnownNat dim, KnownNat idx, InRange shape dim idx, shape' ~ Remove shape dim) => Tensor device dtype shape -> Tensor device dtype shape' Source #
(<.) :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
mul :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (dtype'' :: DType) (device :: (DeviceType, Nat)). (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 #
data Tensor (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) where Source #
Constructors
UnsafeMkTensor :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]). 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 Associated Types
| |||||||||||||
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 uncast :: ForeignPtr TensorList -> ([Tensor device dtype shape] -> IO r) -> IO r | |||||||||||||
(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 | |||||||||||||
(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 # | |||||||||||||
TensorOptions shape dtype device => Default (Tensor device dtype shape) Source # | |||||||||||||
Defined in Torch.Typed.Factories | |||||||||||||
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 # (-) :: Tensor device dtype shape -> Tensor device dtype shape -> Tensor device dtype shape # (*) :: Tensor device dtype shape -> Tensor device dtype shape -> Tensor device dtype shape # negate :: Tensor device dtype shape -> Tensor device dtype shape # abs :: Tensor device dtype shape -> Tensor device dtype shape # signum :: Tensor device dtype shape -> Tensor device dtype shape # fromInteger :: Integer -> Tensor device dtype shape # | |||||||||||||
KnownDevice device => Fractional (Tensor device dtype shape) Source # | |||||||||||||
Show (Tensor device dtype shape) Source # | |||||||||||||
Parameterized (Tensor device dtype shape) Source # | |||||||||||||
Defined in Torch.Typed.Parameter Associated Types
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
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 Methods cast :: Tensor device dtype shape -> (ATenTensor -> IO r) -> IO r uncast :: ATenTensor -> (Tensor device dtype shape -> IO r) -> IO r | |||||||||||||
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 |
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 |
dtype :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) 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 :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) t. (TensorOptions shape dtype device, IsUnnamed t device dtype shape) => t -> Device Source #
returns tensor device uses compile-time information only
data NamedTensor (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: Shape) where Source #
Constructors
FromTensor :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: Shape) (shape1 :: [Nat]). shape1 ~ ToNats shape => Tensor device dtype shape1 -> NamedTensor device dtype shape |
Instances
(TensorOptions shape' dtype device, shape' ~ ToNats shape) => Default (NamedTensor device dtype shape) Source # | |||||||||||||
Defined in Torch.Typed.Factories Methods def :: NamedTensor device dtype shape # | |||||||||||||
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 # (-) :: NamedTensor device dtype shape -> NamedTensor device dtype shape -> NamedTensor device dtype shape # (*) :: NamedTensor device dtype shape -> NamedTensor device dtype shape -> NamedTensor device dtype shape # negate :: NamedTensor device dtype shape -> NamedTensor device dtype shape # abs :: NamedTensor device dtype shape -> NamedTensor device dtype shape # signum :: NamedTensor device dtype shape -> NamedTensor device dtype shape # fromInteger :: Integer -> NamedTensor device dtype shape # | |||||||||||||
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 # recip :: NamedTensor device dtype shape -> NamedTensor device dtype shape # fromRational :: Rational -> NamedTensor device dtype shape # | |||||||||||||
Show (NamedTensor device dtype shape) Source # | |||||||||||||
Defined in Torch.Typed.Tensor Methods showsPrec :: Int -> NamedTensor device dtype shape -> ShowS # show :: NamedTensor device dtype shape -> String # showList :: [NamedTensor device dtype shape] -> ShowS # | |||||||||||||
Unnamed (NamedTensor device dtype shape) Source # | |||||||||||||
Defined in Torch.Typed.Tensor Associated Types
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 uncast :: ATenTensor -> (NamedTensor device dtype shape -> IO r) -> IO r | |||||||||||||
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 |
lt :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
gt :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
class Unnamed t where Source #
Methods
toUnnamed :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]). IsUnnamed t device dtype shape => t -> Tensor device dtype shape Source #
fromUnnamed :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]). 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
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
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 # |
dim :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) t. (TensorOptions shape dtype device, IsUnnamed t device dtype shape) => t -> Int Source #
returns tensor dimension uses compile-time information only
shape :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) t. (TensorOptions shape dtype device, IsUnnamed t device dtype shape) => t -> [Int] Source #
returns tensor shape as list uses compile-time information only
withTensor :: Tensor -> (forall (shape :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)). (KnownDevice device, KnownDType dtype, KnownShape shape) => Tensor device dtype shape -> r) -> r Source #
toDouble :: forall (device :: (DeviceType, Nat)). Tensor device 'Double ('[] :: [Nat]) -> Double Source #
toInt :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]). Tensor device dtype shape -> Int Source #
reshape :: forall (shape' :: [Nat]) (shape :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)). (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]]]
toSparse :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]). Tensor device dtype shape -> Tensor device dtype shape Source #
toDense :: forall (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]). Tensor device dtype shape -> Tensor device dtype shape Source #
toCPU :: forall (device :: (DeviceType, Nat)) (shape :: [Nat]) (dtype :: DType). Tensor device dtype shape -> CPUTensor dtype shape Source #
move tensor to CPU TODO: can this fail?
toCUDA :: forall {k} (device' :: k) (device :: (DeviceType, Nat)) (shape :: [Nat]) (dtype :: DType). Tensor device dtype shape -> CUDATensor 0 dtype shape Source #
move tensor to the first CUDA device TODO: what if this fails?
toMPS :: forall {k} (device' :: k) (device :: (DeviceType, Nat)) (shape :: [Nat]) (dtype :: DType). Tensor device dtype shape -> MPSTensor 0 dtype shape Source #
move tensor to the first MPS device TODO: what if this fails?
matmul :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)). (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.
ne :: forall (shape'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (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'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (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'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (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'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (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'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (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'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (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'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (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'' :: [Nat]) (shape :: [Nat]) (shape' :: [Nat]) (dtype :: DType) (dtype' :: DType) (device :: (DeviceType, Nat)). (shape'' ~ Broadcast shape shape', ComparisonDTypeIsValid device dtype, ComparisonDTypeIsValid device dtype') => Tensor device dtype shape -> Tensor device dtype' shape' -> Tensor device 'Bool shape'' Source #
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 |
class KnownDType (dtype :: DType) where Source #
Instances
KnownDType 'Bool Source # | |
Defined in Torch.Typed.Tensor | |
KnownDType 'ComplexDouble Source # | |
Defined in Torch.Typed.Tensor | |
KnownDType 'ComplexFloat Source # | |
Defined in Torch.Typed.Tensor | |
KnownDType 'ComplexHalf 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 |
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 Half = 'Half | |
ComputeDType 'Half = 'Half | |
ComputeDType Float = 'Float | |
ComputeDType 'Float = 'Float | |
ComputeDType Double = 'Double | |
ComputeDType 'Double = 'Double | |
ComputeDType (Complex Half) = 'ComplexHalf | |
ComputeDType 'ComplexHalf = 'ComplexHalf | |
ComputeDType (Complex Float) = 'ComplexFloat | |
ComputeDType 'ComplexFloat = 'ComplexFloat | |
ComputeDType (Complex Double) = 'ComplexDouble | |
ComputeDType 'ComplexDouble = 'ComplexDouble | |
ComputeDType (dtype' :: t) = TypeError ('Text "Unsupported tensor type " ':<>: 'ShowType dtype') :: DType |
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 | |
KnownNat n => KnownDevice '('MPS, n) Source # | |
Defined in Torch.Typed.Tensor |
type family ToNat (shape :: Size) :: Nat where ... Source #
Equations
ToNat (S1 ('MetaSel _1 _2 _3 _4) f) = ToNat f | |
ToNat (D1 _1 f) = ToNat f | |
ToNat (C1 _1 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 _1) :: Type -> Type) = n | |
ToNat (K1 _1 _2 :: Type -> Type) = 1 | |
ToNat (U1 :: Type -> Type) = 1 | |
ToNat (Vector n) = n | |
ToNat a = ToNat (Rep (a ())) |
type family UTShape t :: [Nat] Source #
Instances
type UTShape (NamedTensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor | |
type UTShape (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor |
type family UTDevice t :: (DeviceType, Nat) Source #
Instances
type UTDevice (NamedTensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor | |
type UTDevice (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor |
type family UTDType t :: DType Source #
Instances
type UTDType (NamedTensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor | |
type UTDType (Tensor device dtype shape) Source # | |
Defined in Torch.Typed.Tensor |
type family IsUnnamed t (device :: (DeviceType, Nat)) (dtype :: DType) (shape :: [Nat]) where ... Source #
data UnknownShapeTensor (device :: (DeviceType, Nat)) (dtype :: DType) Source #
Constructors
UnknownShapeTensor (Tensor device dtype shape) |
type family ComputeHaskellType (dtype :: DType) where ... Source #
Equations
ComputeHaskellType 'Bool = Bool | |
ComputeHaskellType 'Int64 = Int | |
ComputeHaskellType 'Float = Float | |
ComputeHaskellType 'Double = Double | |
ComputeHaskellType dtype = TypeError ('Text "Unsupported tensor type " ':<>: 'ShowType dtype) :: Type |
type family ComputeItemType ty (shape :: [Nat]) where ... Source #
Equations
ComputeItemType _1 ('[] :: [Nat]) = TypeError ('Text "Scalars are not supported") :: Type | |
ComputeItemType ty '[_1] = ty | |
ComputeItemType ty (_1 ': (h ': t)) = [ComputeItemType ty (h ': t)] |
Constructors
SomeShape :: forall (shape :: [Nat]). KnownShape shape => Proxy shape -> SomeShape |
Constructors
SomeDType :: forall (dtype :: DType). KnownDType dtype => Proxy dtype -> SomeDType |
data SomeDevice where Source #
Constructors
SomeDevice :: forall (device :: (DeviceType, Nat)). KnownDevice device => Proxy device -> SomeDevice |
someDevice :: Device -> SomeDevice Source #
withTensorShape :: forall (device :: (DeviceType, Nat)) (dtype :: DType) r. (KnownDevice device, KnownDType dtype) => Tensor -> (forall (shape :: [Nat]). KnownShape shape => Tensor device dtype shape -> r) -> r Source #
type family ComputeBroadcast (reversedShape :: [Nat]) (reversedShape' :: [Nat]) :: Maybe [Nat] where ... Source #
Equations
ComputeBroadcast ('[] :: [Nat]) reversedShape = 'Just reversedShape | |
ComputeBroadcast reversedShape ('[] :: [Nat]) = '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 _1 _2 = 'Nothing :: Maybe [Nat] |
type family CheckBroadcast (shape :: [Nat]) (shape' :: [Nat]) (result :: Maybe [Nat]) :: [Nat] where ... Source #
type Broadcast (shape :: [Nat]) (shape' :: [Nat]) = CheckBroadcast shape shape' (ComputeBroadcast (Reverse shape) (Reverse shape')) Source #
type family BasicArithmeticDTypeIsValid (device :: (DeviceType, Nat)) (dtype :: DType) where ... Source #
Equations
BasicArithmeticDTypeIsValid '('CPU, 0) dtype = (DTypeIsNotBool '('CPU, 0) dtype, DTypeIsNotHalf '('CPU, 0) dtype) | |
BasicArithmeticDTypeIsValid '('CUDA, _1) dtype = () | |
BasicArithmeticDTypeIsValid '('MPS, 0) dtype = () | |
BasicArithmeticDTypeIsValid '(deviceType, _1) dtype = UnsupportedDTypeForDevice deviceType dtype |
type family ComparisonDTypeIsValid (device :: (DeviceType, Nat)) (dtype :: DType) where ... Source #
Equations
ComparisonDTypeIsValid '('CPU, 0) dtype = (DTypeIsNotBool '('CPU, 0) dtype, DTypeIsNotHalf '('CPU, 0) dtype) | |
ComparisonDTypeIsValid '('CUDA, _1) dtype = () | |
ComparisonDTypeIsValid '('MPS, 0) dtype = () | |
ComparisonDTypeIsValid '(deviceType, _1) dtype = UnsupportedDTypeForDevice deviceType dtype |
type family ComputeMatMul (reversedShape :: [Nat]) (reversedShape' :: [Nat]) :: Maybe [Nat] where ... Source #
Equations
ComputeMatMul '[k] '[k] = 'Just ('[] :: [Nat]) | |
ComputeMatMul '[k] (m ': (k ': reversedBroadcastShape')) = AppendToMaybe m (ComputeBroadcast ('[] :: [Nat]) reversedBroadcastShape') | |
ComputeMatMul (k ': (n ': reversedBroadcastShape)) '[k] = AppendToMaybe n (ComputeBroadcast ('[] :: [Nat]) reversedBroadcastShape) | |
ComputeMatMul (k ': (n ': reversedBroadcastShape)) (m ': (k ': reversedBroadcastShape')) = AppendToMaybe m (AppendToMaybe n (ComputeBroadcast reversedBroadcastShape reversedBroadcastShape')) |
type family CheckMatMul (shape :: [Nat]) (shape' :: [Nat]) (result :: Maybe [Nat]) :: [Nat] where ... Source #
type MatMul (shape :: [Nat]) (shape' :: [Nat]) = CheckMatMul shape shape' (ComputeMatMul (Reverse shape) (Reverse shape')) Source #
type family MatMulDTypeIsValid (device :: (DeviceType, Nat)) (dtype :: DType) where ... Source #
Equations
MatMulDTypeIsValid '('CPU, 0) dtype = (DTypeIsNotBool '('CPU, 0) dtype, DTypeIsNotHalf '('CPU, 0) dtype) | |
MatMulDTypeIsValid '('CUDA, deviceIndex) dtype = DTypeIsFloatingPoint '('CUDA, deviceIndex) dtype | |
MatMulDTypeIsValid '('MPS, 0) dtype = DTypeIsFloatingPoint '('MPS, 0) dtype | |
MatMulDTypeIsValid '(deviceType, _1) dtype = UnsupportedDTypeForDevice deviceType dtype |
selectIdx :: forall (dim :: Nat) (n :: Nat) (shape' :: [Nat]) (shape :: [Nat]) (dtype :: DType) (device :: (DeviceType, Nat)). (KnownNat dim, n ~ Index shape dim, shape' ~ Remove shape dim) => Tensor device dtype shape -> Finite n -> Tensor device dtype shape' Source #
To avoid overlapped instance for (Unnamed t => Castable t D.ATenTensor)
Instances
Unnamed t => Castable (Wrap t) ATenTensor Source # | |
Defined in Torch.Typed.Tensor Methods cast :: Wrap t -> (ATenTensor -> IO r) -> IO r uncast :: ATenTensor -> (Wrap t -> IO r) -> IO r |
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 # |
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 # |
type family ReplaceDevice'' (tensor :: t) (device :: (DeviceType, Nat)) :: t where ... Source #
Equations
ReplaceDevice'' (Tensor device0 dtype shape :: Type) device1 = Tensor device1 dtype shape | |
ReplaceDevice'' (NamedTensor device0 dtype shape :: Type) device1 = NamedTensor device1 dtype shape |
type family ReplaceDType'' (tensor :: t) (dtype :: DType) :: t where ... Source #
Equations
ReplaceDType'' (Tensor device dtype0 shape :: Type) dtype1 = Tensor device dtype1 shape | |
ReplaceDType'' (NamedTensor device dtype0 shape :: Type) dtype1 = NamedTensor device dtype1 shape |
toFloat :: forall (device :: (DeviceType, Nat)). Tensor device 'Float ('[] :: [Nat]) -> Float Source #
module Torch.Typed.Vision
Constructors
Device | |
Fields
|
data DeviceType Source #
Instances
Show DeviceType Source # | |
Defined in Torch.Device Methods showsPrec :: Int -> DeviceType -> ShowS # show :: DeviceType -> String # showList :: [DeviceType] -> ShowS # | |
Eq DeviceType Source # | |
Defined in Torch.Device | |
Ord DeviceType Source # | |
Defined in Torch.Device Methods compare :: DeviceType -> DeviceType -> Ordering # (<) :: DeviceType -> DeviceType -> Bool # (<=) :: DeviceType -> DeviceType -> Bool # (>) :: DeviceType -> DeviceType -> Bool # (>=) :: DeviceType -> DeviceType -> Bool # max :: DeviceType -> DeviceType -> DeviceType # min :: DeviceType -> DeviceType -> DeviceType # | |
Castable DeviceType DeviceType Source # | |
Defined in Torch.Device Methods cast :: DeviceType -> (DeviceType -> IO r) -> IO r uncast :: DeviceType -> (DeviceType -> IO r) -> IO r | |
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 # | |
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 | |
KnownNat n => KnownDevice '('MPS, 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
Read DType Source # | |
Show DType Source # | |
Eq DType Source # | |
Castable DType ScalarType Source # | |
Reifies 'Bool DType Source # | |
Defined in Torch.DType | |
Reifies 'ComplexDouble DType Source # | |
Defined in Torch.DType Methods reflect :: proxy 'ComplexDouble -> DType # | |
Reifies 'ComplexFloat DType Source # | |
Defined in Torch.DType Methods reflect :: proxy 'ComplexFloat -> DType # | |
Reifies 'ComplexHalf DType Source # | |
Defined in Torch.DType Methods reflect :: proxy 'ComplexHalf -> DType # | |
Reifies 'Double DType Source # | |
Defined in Torch.DType | |
Reifies 'Float DType Source # | |
Defined in Torch.DType | |
Reifies 'Half DType Source # | |
Defined in Torch.DType | |
Reifies 'Int16 DType Source # | |
Defined in Torch.DType | |
Reifies 'Int32 DType Source # | |
Defined in Torch.DType | |
Reifies 'Int64 DType Source # | |
Defined in Torch.DType | |
Reifies 'Int8 DType Source # | |
Defined in Torch.DType | |
Reifies Int16 DType Source # | |
Defined in Torch.DType | |
Reifies Int32 DType Source # | |
Defined in Torch.DType | |
Reifies Int64 DType Source # | |
Defined in Torch.DType | |
Reifies Int8 DType Source # | |
Defined in Torch.DType | |
Reifies Word8 DType Source # | |
Defined in Torch.DType | |
Reifies Half DType Source # | |
Defined in Torch.DType | |
Reifies Bool DType Source # | |
Defined in Torch.DType | |
Reifies Double DType Source # | |
Defined in Torch.DType | |
Reifies Float DType Source # | |
Defined in Torch.DType | |
Reifies Int DType Source # | |
Defined in Torch.DType | |
(g ~ ReplaceDType f dtype' dtype, f ~ ReplaceDType g dtype dtype', Generic f, Generic g, GHasToDType dtype' dtype (Rep f) (Rep g)) => HasToDType (dtype' :: DType) (dtype :: DType) f g Source # | |
Defined in Torch.Typed.DType | |
KnownDType dtype' => HasToDType (dtype' :: DType) (dtype :: DType) (Parameter device dtype shape) (Parameter device dtype' shape) Source # | |
KnownDType dtype' => HasToDType (dtype' :: DType) (dtype :: DType) (Tensor device dtype shape) (Tensor device dtype' shape) Source # | |
Reifies (Complex Half) DType Source # | |
Reifies (Complex Double) DType Source # | |
Reifies (Complex Float) DType Source # | |
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 # | |