Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data IndexType a
- = NewAxis
- | Ellipsis
- | SliceAll
- | SliceAt a
- | SliceBool Bool
- | SliceFrom a
- | SliceUpTo a
- | SliceWithStep a
- | SliceFromUpTo a a
- | SliceFromWithStep a a
- | SliceUpToWithStep a a
- | SliceFromUpToWithStep a a a
- data SIndexType :: forall (a :: Type). IndexType a -> Type where
- SNewAxis :: forall (a :: Type). SIndexType ('NewAxis :: IndexType (a :: Type))
- SEllipsis :: forall (a :: Type). SIndexType ('Ellipsis :: IndexType (a :: Type))
- SSliceAll :: forall (a :: Type). SIndexType ('SliceAll :: IndexType (a :: Type))
- SSliceAt :: forall (a :: Type) (n :: a). (Sing n) -> SIndexType ('SliceAt n :: IndexType (a :: Type))
- SSliceBool :: forall (a :: Type) (n :: Bool). (Sing n) -> SIndexType ('SliceBool n :: IndexType (a :: Type))
- SSliceFrom :: forall (a :: Type) (n :: a). (Sing n) -> SIndexType ('SliceFrom n :: IndexType (a :: Type))
- SSliceUpTo :: forall (a :: Type) (n :: a). (Sing n) -> SIndexType ('SliceUpTo n :: IndexType (a :: Type))
- SSliceWithStep :: forall (a :: Type) (n :: a). (Sing n) -> SIndexType ('SliceWithStep n :: IndexType (a :: Type))
- SSliceFromUpTo :: forall (a :: Type) (n :: a) (n :: a). (Sing n) -> (Sing n) -> SIndexType ('SliceFromUpTo n n :: IndexType (a :: Type))
- SSliceFromWithStep :: forall (a :: Type) (n :: a) (n :: a). (Sing n) -> (Sing n) -> SIndexType ('SliceFromWithStep n n :: IndexType (a :: Type))
- SSliceUpToWithStep :: forall (a :: Type) (n :: a) (n :: a). (Sing n) -> (Sing n) -> SIndexType ('SliceUpToWithStep n n :: IndexType (a :: Type))
- SSliceFromUpToWithStep :: forall (a :: Type) (n :: a) (n :: a) (n :: a). (Sing n) -> (Sing n) -> (Sing n) -> SIndexType ('SliceFromUpToWithStep n n n :: IndexType (a :: Type))
- data Indices (indexTypes :: Type) where
- UncheckedIndices :: forall indexTypes. Indices indexTypes
- Indices :: forall indexTypes. indexTypes -> Indices indexTypes
- data SIndices (indices :: Indices [IndexType (Index Nat)]) where
- SUncheckedIndices :: [IndexType Integer] -> SIndices 'UncheckedIndices
- SIndices :: forall indexTypes. SList indexTypes -> SIndices ('Indices indexTypes)
- type family IndexDims indices shape where ...
- (!) :: forall indices requiresGradient layout device dataType shape m. MonadThrow m => Tensor requiresGradient layout device dataType shape -> SIndices indices -> m (Tensor requiresGradient layout device dataType (IndexDims indices shape))
- slice :: QuasiQuoter
Documentation
NewAxis | |
Ellipsis | |
SliceAll | |
SliceAt a | |
SliceBool Bool | |
SliceFrom a | |
SliceUpTo a | |
SliceWithStep a | |
SliceFromUpTo a a | |
SliceFromWithStep a a | |
SliceUpToWithStep a a | |
SliceFromUpToWithStep a a a |
Instances
data SIndexType :: forall (a :: Type). IndexType a -> Type where Source #
SNewAxis :: forall (a :: Type). SIndexType ('NewAxis :: IndexType (a :: Type)) | |
SEllipsis :: forall (a :: Type). SIndexType ('Ellipsis :: IndexType (a :: Type)) | |
SSliceAll :: forall (a :: Type). SIndexType ('SliceAll :: IndexType (a :: Type)) | |
SSliceAt :: forall (a :: Type) (n :: a). (Sing n) -> SIndexType ('SliceAt n :: IndexType (a :: Type)) | |
SSliceBool :: forall (a :: Type) (n :: Bool). (Sing n) -> SIndexType ('SliceBool n :: IndexType (a :: Type)) | |
SSliceFrom :: forall (a :: Type) (n :: a). (Sing n) -> SIndexType ('SliceFrom n :: IndexType (a :: Type)) | |
SSliceUpTo :: forall (a :: Type) (n :: a). (Sing n) -> SIndexType ('SliceUpTo n :: IndexType (a :: Type)) | |
SSliceWithStep :: forall (a :: Type) (n :: a). (Sing n) -> SIndexType ('SliceWithStep n :: IndexType (a :: Type)) | |
SSliceFromUpTo :: forall (a :: Type) (n :: a) (n :: a). (Sing n) -> (Sing n) -> SIndexType ('SliceFromUpTo n n :: IndexType (a :: Type)) | |
SSliceFromWithStep :: forall (a :: Type) (n :: a) (n :: a). (Sing n) -> (Sing n) -> SIndexType ('SliceFromWithStep n n :: IndexType (a :: Type)) | |
SSliceUpToWithStep :: forall (a :: Type) (n :: a) (n :: a). (Sing n) -> (Sing n) -> SIndexType ('SliceUpToWithStep n n :: IndexType (a :: Type)) | |
SSliceFromUpToWithStep :: forall (a :: Type) (n :: a) (n :: a) (n :: a). (Sing n) -> (Sing n) -> (Sing n) -> SIndexType ('SliceFromUpToWithStep n n n :: IndexType (a :: Type)) |
data Indices (indexTypes :: Type) where Source #
UncheckedIndices :: forall indexTypes. Indices indexTypes | |
Indices :: forall indexTypes. indexTypes -> Indices indexTypes |
Instances
SingKind (Indices [IndexType (Index Nat)]) Source # | |
Defined in Torch.GraduallyTyped.Tensor.Indexing | |
SingI indexTypes => SingI ('Indices indexTypes :: Indices [IndexType (Index Nat)]) Source # | |
type Demote (Indices [IndexType (Index Nat)]) Source # | |
type Sing Source # | |
Defined in Torch.GraduallyTyped.Tensor.Indexing |
data SIndices (indices :: Indices [IndexType (Index Nat)]) where Source #
SUncheckedIndices :: [IndexType Integer] -> SIndices 'UncheckedIndices | |
SIndices :: forall indexTypes. SList indexTypes -> SIndices ('Indices indexTypes) |
type family IndexDims indices shape where ... Source #
IndexDims 'UncheckedIndices _ = 'UncheckedShape | |
IndexDims _ 'UncheckedShape = 'UncheckedShape | |
IndexDims ('Indices indices) ('Shape dims) = IndexDimsImpl indices dims |
(!) :: forall indices requiresGradient layout device dataType shape m. MonadThrow m => Tensor requiresGradient layout device dataType shape -> SIndices indices -> m (Tensor requiresGradient layout device dataType (IndexDims indices shape)) Source #
slice :: QuasiQuoter Source #
Generate a slice from a python compatible expression. When you take the odd-numberPed element of tensor with `tensor[1::2]` in python, you can write `tensor ! [slice|1::2|]` in hasktorch.