cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
unfolding.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_FUNCTIONS_UNFOLDING_H
4#define pRC_CORE_TENSOR_FUNCTIONS_UNFOLDING_H
5
7
8namespace pRC
9{
10 template<Index K, class X, IsTensorish R = RemoveReference<X>>
11 requires(K + 1 < R::Dimension)
12 static inline constexpr auto unfolding(X &&a)
13 {
14 return reshape<decltype(trim<0, K + 1>(typename R::Sizes()))::size(),
15 decltype(trim<K + 1, R::Dimension>(typename R::Sizes{}))::size()>(
16 forward<X>(a));
17 }
18}
19#endif // pRC_CORE_TENSOR_FUNCTIONS_UNFOLDING_H
Definition cholesky.hpp:10
static constexpr auto trim(Sequence< T, Is... > const)
Definition sequence.hpp:643
static constexpr auto reshape(X &&a)
Definition reshape.hpp:14
static constexpr auto unfolding(X &&a)
Definition unfolding.hpp:12