pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
scalar.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_TENSOR_FUNCTIONS_SCALAR_H
4#define pRC_CORE_TENSOR_FUNCTIONS_SCALAR_H
5
8
9namespace pRC
10{
18 template<class X, class R = RemoveReference<X>, If<IsTensorish<R>> = 0,
19 If<IsSatisfied<(R::Sizes::size() == 1)>> = 0,
20 If<IsInvocable<Reshape<>, X>> = 0>
21 static inline constexpr auto scalar(X &&a)
22 {
23 return reshape<>(forward<X>(a));
24 }
25}
26#endif // pRC_CORE_TENSOR_FUNCTIONS_SCALAR_H
Definition cholesky.hpp:18
static constexpr auto scalar(X &&a)
Casts a Tensor with one element to its Value class.
Definition scalar.hpp:21
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13