|
rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
|
Contract two arrays along one axis, broadcasting the rest. More...
#include <rexlib/ops/linalg/vecdot_operation.hpp>
Additional Inherited Members | |
Public Types inherited from rexlib::parametric_operation< vecdot_operation, vecdot_operation_traits > | |
| using | parameters_type = typename Traits::parameters_type |
| using | signature_type = rule_signature< shape_rule_type, type_rule_type, parameters_type > |
Public Types inherited from rexlib::basic_operation< Derived, Traits > | |
| using | traits_type = Traits |
| using | shape_rule_type = typename Traits::shape_rule_type |
| using | type_rule_type = typename Traits::type_rule_type |
Public Member Functions inherited from rexlib::parametric_operation< vecdot_operation, vecdot_operation_traits > | |
| parametric_operation (Args &&... args) | |
| Construct the operation by constructing its parameters. | |
| const parameters_type & | get_parameters () const noexcept |
| Get the parameters of the operation. | |
| const operation_signature & | get_signature () const noexcept override |
| Get the signature deciding the shape and data type of the operands of this operation. | |
Public Member Functions inherited from rexlib::basic_operation< Derived, Traits > | |
| const operation_descriptor & | get_descriptor () const noexcept override |
| Get the description of this operation. | |
| operation_id | get_id () const noexcept override |
Get the identifier of Derived. | |
Public Member Functions inherited from rexlib::operation | |
| operation (const operation &other)=delete | |
| operation (operation &&other)=delete | |
| operation & | operator= (const operation &other)=delete |
| operation & | operator= (operation &&other)=delete |
Static Public Member Functions inherited from rexlib::basic_operation< Derived, Traits > | |
| static const operation_descriptor & | get_static_descriptor () noexcept |
| Get the description shared by every instance. | |
Static Public Attributes inherited from rexlib::basic_operation< Derived, Traits > | |
| static REXLIB_CONST_CONSTEXPR std::size_t | output_operand_count |
| static REXLIB_CONST_CONSTEXPR std::size_t | input_operand_count |
Contract two arrays along one axis, broadcasting the rest.
The products are summed along one axis, which holds as many elements in both operands and which the result loses. Every other axis is a batch dimension, broadcast between the operands, so a stack of vectors contracts with another stack, or with a single vector, without any of them being written out.
This is where it differs from dot, which keeps the leading axes of both operands rather than broadcasting them, and from matmul, which treats the last two axes as a matrix rather than the last one as a vector.