hasktorch-0.2.0.0: Functional differentiable programming in Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Torch.TensorFactories

Synopsis

Documentation

mkFactory Source #

Arguments

:: FactoryType

aten_impl

-> [Int]

shape

-> TensorOptions

opts

-> IO Tensor

output

mkDefaultFactory :: ([Int] -> TensorOptions -> a) -> [Int] -> 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

-> TensorOptions

opt

-> IO Tensor

output

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.

-> TensorOptions 
-> Tensor

output

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

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

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

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

full' :: Scalar a => [Int] -> a -> 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.