Tannic
A C++ Tensor Library
Loading...
Searching...
No Matches
tannic::Operator Concept Reference

Concept defining requirements for tensor operation types. More...

#include <concepts.hpp>

Concept definition

template<typename T>
concept tannic::Operator = requires(T operation, const Shape& first, const Shape& second) {
{ T::promote(type{}, type{}) } -> std::same_as<type>;
{ T::broadcast(first, second) } -> std::same_as<Shape>;
}
Concept defining requirements for tensor operation types.
Definition: concepts.hpp:110

Detailed Description

Concept defining requirements for tensor operation types.

This concept specifies the interface that all tensor operators must implement:

  • Type promotion rules between operands
  • Shape broadcasting behavior

A type satisfies the Operator concept if it provides:

  1. A static promote method that determines the result type from two input types
  2. A static broadcast method that computes the output shape from two input shapes
See also
Operations.hpp (tensor operations)