87 { expression.dtype() } -> std::same_as<type>;
88 { expression.shape() } -> std::same_as<Shape const&>;
89 { expression.strides() } -> std::same_as<Strides const&>;
110concept Operator =
requires(T operation,
const Shape& first,
const Shape& second) {
111 { T::promote(type{}, type{}) } -> std::same_as<type>;
112 { T::broadcast(first, second) } -> std::same_as<Shape>;
123template<
typename Function>
124concept Functional =
requires(Function function,
const Tensor& input, Tensor& output) {
125 { function(input, output) } -> std::same_as<void>;
133concept Iterable =
requires(T type) { std::begin(type); std::end(type); };
171concept Assignable =
requires(T t,
const std::byte* ptr, std::ptrdiff_t offset) {
172 { t.assign(ptr, offset) } -> std::same_as<void>;
195concept Comparable =
requires(
const T t,
const std::byte* ptr, std::ptrdiff_t offset) {
196 { t.compare(ptr, offset) } -> std::same_as<bool>;
Concept for types that can assign values.
Definition: concepts.hpp:171
Concept for types that can compare their value.
Definition: concepts.hpp:195
Defines the core protocol for all expression-like types in the Tannic Tensor Library.
Definition: concepts.hpp:86
Concept for unary mathematical function operations.
Definition: concepts.hpp:124
Requires a type to be an integral type (e.g., int, std::size_t).
Definition: concepts.hpp:147
Requires a type to be iterable via std::begin and std::end.
Definition: concepts.hpp:133
Requires a type to satisfy the C++20 std::input_iterator concept.
Definition: concepts.hpp:140
Concept defining requirements for tensor operation types.
Definition: concepts.hpp:110
Definition: buffer.hpp:41