Copyright | (c) Sam Stites 2017 |
---|---|
License | BSD3 |
Maintainer | sam@stites.io |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Blas functions.
Synopsis
- addmv :: HsReal -> Dynamic -> HsReal -> Dynamic -> Dynamic -> Dynamic
- addmm :: HsReal -> Dynamic -> HsReal -> Dynamic -> Dynamic -> Dynamic
- addr :: HsReal -> Dynamic -> HsReal -> Dynamic -> Dynamic -> Dynamic
- addbmm :: HsReal -> Dynamic -> HsReal -> Dynamic -> Dynamic -> Dynamic
- baddbmm :: HsReal -> Dynamic -> HsReal -> Dynamic -> Dynamic -> Dynamic
- addmv_ :: HsReal -> Dynamic -> HsReal -> Dynamic -> Dynamic -> IO ()
- addmm_ :: HsReal -> Dynamic -> HsReal -> Dynamic -> Dynamic -> IO ()
- addr_ :: HsReal -> Dynamic -> HsReal -> Dynamic -> Dynamic -> IO ()
- addbmm_ :: HsReal -> Dynamic -> HsReal -> Dynamic -> Dynamic -> IO ()
- baddbmm_ :: HsReal -> Dynamic -> HsReal -> Dynamic -> Dynamic -> IO ()
- dot :: Dynamic -> Dynamic -> HsAccReal
- (<.>) :: Dynamic -> Dynamic -> HsAccReal
Documentation
Performs a matrix-vector multiplication between mat
(2D Tensor) and vec2
(1D Tensor) and add it to vec1
.
Values v1
and v2
are scalars that multiply vec1
and vec2
respectively.
They are optional in C and we may be able to add this to the API in the future.
In other words,
res = (v1 * vec1) + (v2 * (mat * vec2))
Sizes must respect the matrix-multiplication operation: if mat
is a n × m
matrix, vec2
must be vector of size m
and vec1
must be a vector of size
n
.
Performs a matrix-matrix multiplication between mat1
(2D Tensor) and mat2
(2D Tensor).
Values v1
and v2
are scalars that multiply M
and mat1 * mat2
respectively.
They are optional in C and we may be able to add this to the API in the future.
In other words,
res = (v1 * M) + (v2 * mat1 * mat2)
If mat1
is a n × m
matrix, mat2
a m × p
matrix, M
must be a n × p
matrix.
Performs the outer-product between vec1
(1D Tensor) and vec2
(1D Tensor).
Values v1
and v2
are scalars that multiply mat_ij
and vec1_i [out] vec2_j
respectively.
They are optional in C and we may be able to add this to the API in the future.
Thus:
res_ij = (v1 * mat_ij) + (v2 * vec1_i * vec2_j)
If vec1_
is a vector of size i
and vec2_j
is a vector of size j
, then
mat_ij
must be a matrix of size i × j
.
Batch matrix-matrix product of matrices stored in batch1
and batch2
,
with a reduced add step (all matrix multiplications get accumulated in
a single place).
batch1
and batch2
must be 3D Tensors each containing the same number
of matrices. If batch1
is a b × n × m
Tensor, batch2
a b × m × p
Tensor, res
will be a n × p
Tensor.
In other words,
res = (v1 * M) + (v2 * sum(batch1_i * batch2_i, i = 1, b))
Batch matrix matrix product of matrices stored in batch1 and batch2, with batch add.
batch1
and batch2
must be 3D Tensors each containing the same number of
matrices. If batch1
is a b × n × m
Tensor, batch2
a b × m × p
Tensor,
res
will be a b × n × p
Tensor.
In other words,
res_i = (v1 * M_i) + (v2 * batch1_i * batch2_i)
Inline version of addmv
, mutating vec1
inplace.
Inline version of addmm
, mutating M
inplace.
Inline version of addr
, mutating mat_ij
in-place.
Inline version of addbmm
, mutating M
in-place.
Inline version of baddbmm
, mutating M_i
in-place.