Tannic
A C++ Tensor Library
|
Represents the outer product operation between two vectors. More...
#include <transformations.hpp>
Public Member Functions | |
void | forward (Tensor const &first, Tensor const &second, Tensor &result) const |
Static Public Member Functions | |
static constexpr type | promote (type first, type second) |
Type promotion for the outer product operation. | |
static constexpr Shape | transform (Shape const &first, Shape const &second) |
Computes output shape for the outer product of two vectors. | |
Represents the outer product operation between two vectors.
The outer product of two vectors with shapes (n) and (m) results in a matrix of shape (n, m). Currently, only vectors are supported — tensors with rank greater than 1 are not supported, but this may be extended in the future.
void tannic::transformation::Outer::forward | ( | Tensor const & | first, |
Tensor const & | second, | ||
Tensor & | result | ||
) | const |
|
inlinestaticconstexpr |
Type promotion for the outer product operation.
Promotes two operand types to the higher precision type.
first | Type of the first operand (left) |
second | Type of the second operand (right) |
|
inlinestaticconstexpr |
Computes output shape for the outer product of two vectors.
assertion | error if either input tensor is not rank 1 for now outer product only support vectors and not general tensors but this may change in the future. |
The outer product of two vectors with shapes (n) and (m) produces a matrix of shape (n, m). Outer product is not defined here for tensors with rank > 1.