| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Torch.TensorFactories
Synopsis
- type FactoryType = ForeignPtr IntArray -> ForeignPtr TensorOptions -> IO (ForeignPtr Tensor)
- type FactoryTypeWithDimnames = ForeignPtr IntArray -> ForeignPtr DimnameList -> ForeignPtr TensorOptions -> IO (ForeignPtr Tensor)
- mkFactory :: FactoryType -> [Int] -> TensorOptions -> IO Tensor
- mkFactoryUnsafe :: FactoryType -> [Int] -> TensorOptions -> Tensor
- mkFactoryWithDimnames :: FactoryTypeWithDimnames -> [(Int, Dimname)] -> TensorOptions -> IO Tensor
- mkFactoryUnsafeWithDimnames :: FactoryTypeWithDimnames -> [(Int, Dimname)] -> TensorOptions -> Tensor
- mkDefaultFactory :: ([Int] -> TensorOptions -> a) -> [Int] -> a
- mkDefaultFactoryWithDimnames :: ([(Int, Dimname)] -> TensorOptions -> a) -> [(Int, Dimname)] -> a
- ones :: [Int] -> TensorOptions -> Tensor
- onesLike :: Tensor -> Tensor
- zeros :: [Int] -> TensorOptions -> Tensor
- zerosLike :: Tensor -> Tensor
- randIO :: [Int] -> TensorOptions -> IO Tensor
- randnIO :: [Int] -> TensorOptions -> IO Tensor
- randintIO :: Int -> Int -> [Int] -> TensorOptions -> IO Tensor
- randnLikeIO :: Tensor -> IO Tensor
- randLikeIO :: Tensor -> TensorOptions -> IO Tensor
- fullLike :: Tensor -> Float -> TensorOptions -> IO Tensor
- onesWithDimnames :: [(Int, Dimname)] -> TensorOptions -> Tensor
- zerosWithDimnames :: [(Int, Dimname)] -> TensorOptions -> Tensor
- randWithDimnames :: [(Int, Dimname)] -> TensorOptions -> IO Tensor
- randnWithDimnames :: [(Int, Dimname)] -> TensorOptions -> IO Tensor
- linspace :: (Scalar a, Scalar b) => a -> b -> Int -> TensorOptions -> Tensor
- logspace :: (Scalar a, Scalar b) => a -> b -> Int -> Double -> TensorOptions -> Tensor
- eyeSquare :: Int -> TensorOptions -> Tensor
- eye :: Int -> Int -> TensorOptions -> Tensor
- full :: Scalar a => [Int] -> a -> TensorOptions -> Tensor
- sparseCooTensor :: Tensor -> Tensor -> [Int] -> TensorOptions -> Tensor
- ones' :: [Int] -> Tensor
- zeros' :: [Int] -> Tensor
- randIO' :: [Int] -> IO Tensor
- randnIO' :: [Int] -> IO Tensor
- randintIO' :: Int -> Int -> [Int] -> IO Tensor
- randLikeIO' :: Tensor -> IO Tensor
- bernoulliIO' :: Tensor -> IO Tensor
- bernoulliIO :: Tensor -> Double -> IO Tensor
- poissonIO :: Tensor -> IO Tensor
- multinomialIO' :: Tensor -> Int -> IO Tensor
- multinomialIO :: Tensor -> Int -> Bool -> IO Tensor
- normalIO' :: Tensor -> IO Tensor
- normalIO :: Tensor -> Tensor -> IO Tensor
- normalScalarIO :: Tensor -> Double -> IO Tensor
- normalScalarIO' :: Double -> Tensor -> IO Tensor
- normalWithSizeIO :: Double -> Double -> Int -> IO Tensor
- rreluIO''' :: Tensor -> IO Tensor
- rreluIO'' :: Scalar a => Tensor -> a -> IO Tensor
- rreluIO' :: Scalar a => Tensor -> a -> a -> IO Tensor
- rreluIO :: Scalar a => Tensor -> a -> a -> Bool -> IO Tensor
- rreluWithNoiseIO''' :: Tensor -> Tensor -> IO Tensor
- rreluWithNoiseIO'' :: Scalar a => Tensor -> Tensor -> a -> IO Tensor
- rreluWithNoiseIO' :: Scalar a => Tensor -> Tensor -> a -> a -> IO Tensor
- rreluWithNoiseIO :: Scalar a => Tensor -> Tensor -> a -> a -> Bool -> IO Tensor
- onesWithDimnames' :: [(Int, Dimname)] -> Tensor
- zerosWithDimnames' :: [(Int, Dimname)] -> Tensor
- randWithDimnames' :: [(Int, Dimname)] -> IO Tensor
- randnWithDimnames' :: [(Int, Dimname)] -> IO Tensor
- linspace' :: (Scalar a, Scalar b) => a -> b -> Int -> Tensor
- logspace' :: (Scalar a, Scalar b) => a -> b -> Int -> Double -> Tensor
- eyeSquare' :: Int -> Tensor
- eye' :: Int -> Int -> Tensor
- full' :: Scalar a => [Int] -> a -> Tensor
- sparseCooTensor' :: Tensor -> Tensor -> [Int] -> Tensor
- arange :: Int -> Int -> Int -> TensorOptions -> Tensor
- arange' :: Int -> Int -> Int -> Tensor
Documentation
type FactoryType = ForeignPtr IntArray -> ForeignPtr TensorOptions -> IO (ForeignPtr Tensor) Source #
type FactoryTypeWithDimnames = ForeignPtr IntArray -> ForeignPtr DimnameList -> ForeignPtr TensorOptions -> IO (ForeignPtr Tensor) Source #
mkFactoryUnsafe :: FactoryType -> [Int] -> TensorOptions -> Tensor Source #
mkFactoryWithDimnames :: FactoryTypeWithDimnames -> [(Int, Dimname)] -> TensorOptions -> IO Tensor Source #
mkFactoryUnsafeWithDimnames :: FactoryTypeWithDimnames -> [(Int, Dimname)] -> TensorOptions -> Tensor Source #
mkDefaultFactory :: ([Int] -> TensorOptions -> a) -> [Int] -> a Source #
mkDefaultFactoryWithDimnames :: ([(Int, Dimname)] -> TensorOptions -> a) -> [(Int, Dimname)] -> a Source #
Arguments
sequence of integers defining the shape of the output tensor.
configures the data type, device, layout and other properties of the resulting tensor.
output
Returns a tensor filled with the scalar value 1, with the shape defined by the variable argument size.
Returns a tensor filled with the scalar value 1, with the same size as input tensor
Arguments
sequence of integers defining the shape of the output tensor.
configures the data type, device, layout and other properties of the resulting tensor.
output
Returns a tensor filled with the scalar value 0, with the shape defined by the variable argument size.
Returns a tensor filled with the scalar value 0, with the same size as input tensor
Arguments
sequence of integers defining the shape of the output tensor.
configures the data type, device, layout and other properties of the resulting tensor.
Returns a tensor filled with random numbers from a uniform distribution on the interval [0,1)
Arguments
sequence of integers defining the shape of the output tensor.
configures the data type, device, layout and other properties of the resulting tensor.
Returns a tensor filled with random numbers from a standard normal distribution.
Arguments
lowest integer to be drawn from the distribution. Default: 0.
one above the highest integer to be drawn from the distribution.
the shape of the output tensor.
configures the data type, device, layout and other properties of the resulting tensor.
Returns a tensor filled with random integers generated uniformly between low (inclusive) and high (exclusive).
Returns a tensor with the same size as input that is filled with random numbers from standard normal distribution.
Arguments
input
configures the data type, device, layout and other properties of the resulting tensor.
Returns a tensor with the same size as input that is filled with random numbers from a uniform distribution on the interval [0,1).
onesWithDimnames :: [(Int, Dimname)] -> TensorOptions -> Tensor Source #
zerosWithDimnames :: [(Int, Dimname)] -> TensorOptions -> Tensor Source #
randWithDimnames :: [(Int, Dimname)] -> TensorOptions -> IO Tensor Source #
randnWithDimnames :: [(Int, Dimname)] -> TensorOptions -> IO Tensor Source #
Arguments
start
end
steps
configures the data type, device, layout and other properties of the resulting tensor.
output
Returns a one-dimensional tensor of steps equally spaced points between start and end.
Arguments
the number of rows
the number of columns
configures the data type, device, layout and other properties of the resulting tensor.
output
Returns a 2-D tensor with ones on the diagonal and zeros elsewhere.
Arguments
the shape of the output tensor.
the number to fill the output tensor with
configures the data type, device, layout and other properties of the resulting tensor.
output
Returns a tensor of given size filled with fill_value.
Arguments
The indices are the coordinates of the non-zero values in the matrix
Initial values for the tensor.
the shape of the output tensor.
output
Constructs a sparse tensors in COO(rdinate) format with non-zero elements at the given indices with the given values.
eyeSquare' :: Int -> Tensor Source #
Arguments
start
end
step
configures the data type, device, layout and other properties of the resulting tensor.
output
Returns a 1-D tensor with values from the interval [start, end) taken with common difference step beginning from start.