mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-02 00:34:14 +08:00
Fixed a bug in the tensor type converter
This commit is contained in:
parent
ac5d706a94
commit
cd042dbbfd
@ -124,9 +124,12 @@ struct PacketConverter<TensorEvaluator, SrcPacket, TgtPacket, 1, 2> {
|
||||
return internal::pcast<SrcPacket, TgtPacket>(m_impl.template packet<Unaligned>(index));
|
||||
} else {
|
||||
const int TgtPacketSize = internal::unpacket_traits<TgtPacket>::size;
|
||||
typedef typename internal::unpacket_traits<SrcPacket>::type SrcType;
|
||||
typedef typename internal::unpacket_traits<TgtPacket>::type TgtType;
|
||||
internal::scalar_cast_op<SrcType, TgtType> converter;
|
||||
EIGEN_ALIGN_MAX typename internal::unpacket_traits<TgtPacket>::type values[TgtPacketSize];
|
||||
for (int i = 0; i < TgtPacketSize; ++i) {
|
||||
values[i] = m_impl.coeff(index+i);
|
||||
values[i] = converter(m_impl.coeff(index+i));
|
||||
}
|
||||
TgtPacket rslt = internal::pload<TgtPacket>(values);
|
||||
return rslt;
|
||||
|
Loading…
x
Reference in New Issue
Block a user