mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix cast of blfoat16 to std::complex<T>
This fixes https://gitlab.com/libeigen/eigen/-/issues/1951
This commit is contained in:
@@ -34,9 +34,8 @@ namespace Eigen {
|
|||||||
|
|
||||||
struct bfloat16;
|
struct bfloat16;
|
||||||
|
|
||||||
// explicit conversion operators are no available before C++11 so we first cast
|
// Since we allow implicit conversion of bfloat16 to float and double, we
|
||||||
// bfloat16 to RealScalar rather than to std::complex<RealScalar> directly
|
// need to make the cast to complex a bit more explicit
|
||||||
#if !EIGEN_HAS_CXX11
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
template <typename RealScalar>
|
template <typename RealScalar>
|
||||||
struct cast_impl<bfloat16, std::complex<RealScalar> > {
|
struct cast_impl<bfloat16, std::complex<RealScalar> > {
|
||||||
@@ -46,7 +45,6 @@ struct cast_impl<bfloat16, std::complex<RealScalar> > {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
#endif // EIGEN_HAS_CXX11
|
|
||||||
|
|
||||||
namespace bfloat16_impl {
|
namespace bfloat16_impl {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user