hasktorch-0.2.1.8: Haskell bindings to libtorch, supporting both typed and untyped tensors.
Safe HaskellNone
LanguageHaskell2010

Torch.TensorFactories

Synopsis

Documentation

type FactoryType = ForeignPtr IntArray -> ForeignPtr TensorOptions -> IO (ForeignPtr Tensor) Source #

type FactoryTypeWithDimnames = ForeignPtr IntArray -> ForeignPtr DimnameList -> ForeignPtr TensorOptions -> IO (ForeignPtr Tensor) Source #

mkFactory Source #

Arguments

:: FactoryType

aten_impl

-> [Int]

shape

-> TensorOptions

opts

-> IO Tensor

output

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 #

ones Source #

Arguments

:: [Int]

sequence of integers defining the shape of the output tensor.

-> TensorOptions

configures the data type, device, layout and other properties of the resulting tensor.

-> Tensor

output

Returns a tensor filled with the scalar value 1, with the shape defined by the variable argument size.

onesLike Source #

Arguments

:: Tensor

input

-> Tensor

output

Returns a tensor filled with the scalar value 1, with the same size as input tensor

zeros Source #

Arguments

:: [Int]

sequence of integers defining the shape of the output tensor.

-> TensorOptions

configures the data type, device, layout and other properties of the resulting tensor.

-> Tensor

output

Returns a tensor filled with the scalar value 0, with the shape defined by the variable argument size.

zerosLike Source #

Arguments

:: Tensor

input

-> Tensor

output

Returns a tensor filled with the scalar value 0, with the same size as input tensor

randIO Source #

Arguments

:: [Int]

sequence of integers defining the shape of the output tensor.

-> TensorOptions

configures the data type, device, layout and other properties of the resulting tensor.

-> IO Tensor

output

Returns a tensor filled with random numbers from a uniform distribution on the interval [0,1)

randnIO Source #

Arguments

:: [Int]

sequence of integers defining the shape of the output tensor.

-> TensorOptions

configures the data type, device, layout and other properties of the resulting tensor.

-> IO Tensor

output

Returns a tensor filled with random numbers from a standard normal distribution.

randintIO Source #

Arguments

:: Int

lowest integer to be drawn from the distribution. Default: 0.

-> Int

one above the highest integer to be drawn from the distribution.

-> [Int]

the shape of the output tensor.

-> TensorOptions

configures the data type, device, layout and other properties of the resulting tensor.

-> IO Tensor

output

Returns a tensor filled with random integers generated uniformly between low (inclusive) and high (exclusive).

randnLikeIO Source #

Arguments

:: Tensor

input

-> IO Tensor

output

Returns a tensor with the same size as input that is filled with random numbers from standard normal distribution.

randLikeIO Source #

Arguments

:: Tensor

input

-> TensorOptions

configures the data type, device, layout and other properties of the resulting tensor.

-> IO Tensor

output

Returns a tensor with the same size as input that is filled with random numbers from a uniform distribution on the interval [0,1).

fullLike Source #

Arguments

:: Tensor

input

-> Float

_fill_value

-> IO Tensor

output

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 #

linspace Source #

Arguments

:: (Scalar a, Scalar b)
=> a
start
-> b
end
-> Int
steps
-> TensorOptions

configures the data type, device, layout and other properties of the resulting tensor.

-> Tensor

output

Returns a one-dimensional tensor of steps equally spaced points between start and end.

logspace :: (Scalar a, Scalar b) => a -> b -> Int -> Double -> TensorOptions -> Tensor Source #

eyeSquare Source #

Arguments

:: Int

dim

-> TensorOptions

opts

-> Tensor

output

eye Source #

Arguments

:: Int

the number of rows

-> Int

the number of columns

-> TensorOptions

configures the data type, device, layout and other properties of the resulting tensor.

-> Tensor

output

Returns a 2-D tensor with ones on the diagonal and zeros elsewhere.

full Source #

Arguments

:: Scalar a
=> [Int]

the shape of the output tensor.

-> a

the number to fill the output tensor with

-> TensorOptions

configures the data type, device, layout and other properties of the resulting tensor.

-> Tensor

output

Returns a tensor of given size filled with fill_value.

sparseCooTensor Source #

Arguments

:: Tensor

The indices are the coordinates of the non-zero values in the matrix

-> Tensor

Initial values for the tensor.

-> [Int]

the shape of the output tensor.

-> Tensor

output

Constructs a sparse tensors in COO(rdinate) format with non-zero elements at the given indices with the given values.

ones' :: [Int] -> Tensor Source #

zeros' :: [Int] -> Tensor Source #

randIO' :: [Int] -> IO Tensor Source #

randnIO' :: [Int] -> IO Tensor Source #

randintIO' :: Int -> Int -> [Int] -> IO Tensor Source #

randLikeIO' :: Tensor -> IO Tensor Source #

bernoulliIO' Source #

Arguments

:: Tensor

t

-> IO Tensor

output

bernoulliIO Source #

Arguments

:: Tensor

t

-> Double

p

-> IO Tensor

output

poissonIO Source #

Arguments

:: Tensor

t

-> IO Tensor

output

multinomialIO' Source #

Arguments

:: Tensor

t

-> Int

num_samples

-> IO Tensor

output

multinomialIO Source #

Arguments

:: Tensor

t

-> Int

num_samples

-> Bool

replacement

-> IO Tensor

output

normalIO' Source #

Arguments

:: Tensor

_mean

-> IO Tensor

output

normalIO Source #

Arguments

:: Tensor

_mean

-> Tensor

_std

-> IO Tensor

output

normalScalarIO Source #

Arguments

:: Tensor

_mean

-> Double

_std

-> IO Tensor

output

normalScalarIO' Source #

Arguments

:: Double

_mean

-> Tensor

_std

-> IO Tensor

output

normalWithSizeIO Source #

Arguments

:: Double

_mean

-> Double

_std

-> Int

_size

-> IO Tensor

output

rreluIO''' Source #

Arguments

:: Tensor

t

-> IO Tensor

output

rreluIO'' Source #

Arguments

:: Scalar a
=> Tensor

t

-> a

upper

-> IO Tensor

output

rreluIO' Source #

Arguments

:: Scalar a
=> Tensor

t

-> a

lower

-> a

upper

-> IO Tensor

output

rreluIO Source #

Arguments

:: Scalar a
=> Tensor

t

-> a

lower

-> a

upper

-> Bool

training

-> IO Tensor

output

rreluWithNoiseIO''' Source #

Arguments

:: Tensor

t

-> Tensor

noise

-> IO Tensor

output

rreluWithNoiseIO'' Source #

Arguments

:: Scalar a
=> Tensor

t

-> Tensor

noise

-> a

upper

-> IO Tensor

output

rreluWithNoiseIO' Source #

Arguments

:: Scalar a
=> Tensor

t

-> Tensor

noise

-> a

lower

-> a

upper

-> IO Tensor

output

rreluWithNoiseIO Source #

Arguments

:: Scalar a
=> Tensor

t

-> Tensor

noise

-> a

lower

-> a

upper

-> Bool

training

-> IO Tensor

output

onesWithDimnames' :: [(Int, Dimname)] -> Tensor Source #

zerosWithDimnames' :: [(Int, Dimname)] -> Tensor Source #

randWithDimnames' :: [(Int, Dimname)] -> IO Tensor Source #

randnWithDimnames' :: [(Int, Dimname)] -> IO Tensor Source #

linspace' :: (Scalar a, Scalar b) => a -> b -> Int -> Tensor Source #

logspace' :: (Scalar a, Scalar b) => a -> b -> Int -> Double -> Tensor Source #

eyeSquare' :: Int -> Tensor Source #

eye' :: Int -> Int -> Tensor Source #

full' :: Scalar a => [Int] -> a -> Tensor Source #

sparseCooTensor' :: Tensor -> Tensor -> [Int] -> Tensor Source #

arange Source #

Arguments

:: Int

start

-> Int

end

-> Int

step

-> TensorOptions

configures the data type, device, layout and other properties of the resulting tensor.

-> Tensor

output

Returns a 1-D tensor with values from the interval [start, end) taken with common difference step beginning from start.

arange' Source #

Arguments

:: Int

start

-> Int

end

-> Int

step

-> Tensor

output

Returns a 1-D tensor with values from the interval [start, end) taken with common difference step beginning from start.

AltStyle によって変換されたページ (->オリジナル) /