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