mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
Fix cast of blfoat16 to std::complex<T>
This fixes https://gitlab.com/libeigen/eigen/-/issues/1951
This commit is contained in:
parent
bed7fbe854
commit
38b91f256b
@ -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 {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user