| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Torch.Tensor
Contents
Synopsis
- type ATenTensor = ForeignPtr Tensor
- newtype Tensor = Unsafe ATenTensor
- newtype MutableTensor = MutableTensor Tensor
- newMutableTensor :: Tensor -> IO MutableTensor
- toImmutable :: MutableTensor -> IO Tensor
- numel :: Tensor -> Int
- size :: Int -> Tensor -> Int
- shape :: Tensor -> [Int]
- dim :: Tensor -> Int
- dimUnsafe :: Tensor -> Int
- dimCUnsafe :: Tensor -> Int
- device :: Tensor -> Device
- dtype :: Tensor -> DType
- toComplex :: Tensor -> Complex Double
- toDouble :: Tensor -> Double
- toInt :: Tensor -> Int
- _toType :: DType -> Tensor -> Tensor
- toType :: forall a. HasTypes a Tensor => DType -> a -> a
- toDevice :: forall a. HasTypes a Tensor => Device -> a -> a
- _toDevice :: Device -> Tensor -> Tensor
- toDeviceWithTensor :: Tensor -> Tensor -> Tensor
- select :: Int -> Int -> Tensor -> Tensor
- indexSelect :: Int -> Tensor -> Tensor -> Tensor
- indexSelect' :: Int -> [Int] -> Tensor -> Tensor
- sliceDim :: Int -> Int -> Int -> Int -> Tensor -> Tensor
- isContiguous :: Tensor -> Bool
- contiguous :: Tensor -> Tensor
- reshape :: [Int] -> Tensor -> Tensor
- toSparse :: Tensor -> Tensor
- toDense :: Tensor -> Tensor
- toMKLDNN :: Tensor -> Tensor
- toCPU :: Tensor -> Tensor
- toCUDA :: Tensor -> Tensor
- toMPS :: Tensor -> Tensor
- newtype RawTensorIndexList = RawTensorIndexList (ForeignPtr (StdVector TensorIndex))
- newtype RawTensorIndex = RawTensorIndex (ForeignPtr TensorIndex)
- (!) :: TensorIndex a => Tensor -> a -> Tensor
- maskedFill :: (TensorIndex a, TensorLike t) => Tensor -> a -> t -> Tensor
- data None = None
- data Ellipsis = Ellipsis
- newtype Slice a = Slice a
- class TensorIndex a where
- pushIndex :: [RawTensorIndex] -> a -> [RawTensorIndex]
- toLens :: TensorLike b => a -> Lens' Tensor b
- asValue :: TensorLike a => Tensor -> a
- class TensorOptionLike a where
- withTensorOptions :: Tensor -> a -> Tensor
- class TensorLike a where
- bool_opts :: TensorOptions
- uint8_opts :: TensorOptions
- int64_opts :: TensorOptions
- float_opts :: TensorOptions
- double_opts :: TensorOptions
- withTensor :: Tensor -> (Ptr () -> IO a) -> IO a
- _withTensor :: Tensor -> (Ptr () -> IO a) -> IO a
- class AsTensors as where
- class GAsTensors record where
- gToTensors :: record as -> Vector Tensor
Documentation
type ATenTensor = ForeignPtr Tensor Source #
Constructors
| Unsafe ATenTensor |
Instances
newtype MutableTensor Source #
Constructors
| MutableTensor Tensor |
Instances
| Show MutableTensor Source # | |
Defined in Torch.Tensor Methods showsPrec :: Int -> MutableTensor -> ShowS # show :: MutableTensor -> String # showList :: [MutableTensor] -> ShowS # | |
newMutableTensor :: Tensor -> IO MutableTensor Source #
toImmutable :: MutableTensor -> IO Tensor Source #
Returns the total number of elements in the input tensor.
Returns the size of a given dimension of the input tensor.
Returns the shape of the tensor
Returns the device on which the tensor is currently allocated
Returns the data type of the input tensor
Casts the input tensor to the given data type
Casts the input tensor to given device
Arguments
| :: Int | dimension to slice along |
| -> Int | index in the given dimension |
| -> Tensor | input |
| -> Tensor | output |
Slices the input tensor along the selected dimension at the given index.
Returns a new tensor which indexes the input tensor along dimension dim using the entries in index which is a LongTensor.
Slices the input tensor along the selected dimension at the given range.
isContiguous :: Tensor -> Bool Source #
contiguous :: Tensor -> Tensor Source #
reshape :: [Int] -> Tensor -> Tensor Source #
Returns a tensor with the same data and number of elements as input, but with the specified shape.
newtype RawTensorIndexList Source #
Constructors
| RawTensorIndexList (ForeignPtr (StdVector TensorIndex)) |
newtype RawTensorIndex Source #
Constructors
| RawTensorIndex (ForeignPtr TensorIndex) |
Instances
| Castable RawTensorIndex (ForeignPtr TensorIndex) Source # | |
Defined in Torch.Tensor Methods cast :: RawTensorIndex -> (ForeignPtr TensorIndex -> IO r) -> IO r uncast :: ForeignPtr TensorIndex -> (RawTensorIndex -> IO r) -> IO r | |
maskedFill :: (TensorIndex a, TensorLike t) => Tensor -> a -> t -> Tensor Source #
Constructors
| None |
Instances
Constructors
| Ellipsis |
Constructors
| Slice a |
Instances
class TensorIndex a where Source #
Minimal complete definition
Methods
pushIndex :: [RawTensorIndex] -> a -> [RawTensorIndex] Source #
Instances
asValue :: TensorLike a => Tensor -> a Source #
class TensorOptionLike a where Source #
Methods
withTensorOptions :: Tensor -> a -> Tensor Source #
Instances
| TensorOptionLike Tensor Source # | |
Defined in Torch.Tensor | |
| TensorOptionLike TensorOptions Source # | |
Defined in Torch.Tensor Methods withTensorOptions :: Tensor -> TensorOptions -> Tensor Source # | |
class TensorLike a where Source #
Minimal complete definition
asTensor, _asValue, _dtype, _dims, _deepDims, _peekElemOff, _pokeElemOff
Methods
asTensor' :: TensorOptionLike opt => a -> opt -> Tensor Source #
asTensor :: a -> Tensor Source #
_asValue :: Tensor -> a Source #
_deepDims :: a -> Maybe [Int] Source #
Instances
| TensorLike Tensor Source # | |
Defined in Torch.Tensor | |
| TensorLike Bool Source # | |
| (Reifies a DType, Storable a) => TensorLike a Source # | |
| TensorLike a => TensorLike [a] Source # | |
| TensorLike a => TensorLike (a, a) Source # | |
Defined in Torch.Tensor | |
_withTensor :: Tensor -> (Ptr () -> IO a) -> IO a Source #
The internal function of withTensor. It does not check contiguous memory-layout.
class AsTensors as where Source #
Minimal complete definition
Nothing
Methods
Instances
| TensorLike a => AsTensors a Source # | |
class GAsTensors record where Source #
Methods
gToTensors :: record as -> Vector Tensor Source #
Instances
| (GAsTensors ls, GAsTensors rs) => GAsTensors (ls :*: rs) Source # | |
Defined in Torch.Tensor | |
| (GAsTensors ls, GAsTensors rs) => GAsTensors (ls :+: rs) Source # | |
Defined in Torch.Tensor | |
| TensorLike ls => GAsTensors (K1 i ls :: Type -> Type) Source # | |
Defined in Torch.Tensor | |
| GAsTensors ls => GAsTensors (M1 i c ls) Source # | |
Defined in Torch.Tensor | |