Fix tensor broadcast off-by-one error.

Caught by JAX unit tests.  Triggered if broadcast is smaller than packet
size.
This commit is contained in:
Antonio Sanchez 2021-11-15 22:19:04 -08:00 committed by Rasmus Munk Larsen
parent f73c95c032
commit ffb78e23a1

View File

@ -463,8 +463,8 @@ struct TensorEvaluator<const TensorBroadcastingOp<Broadcast, ArgType>, Device>
values[i] = m_impl.coeff(inputIndex);
++outputOffset;
} else {
outputOffset = 0;
values[i] = m_impl.coeff(++inputIndex);
outputOffset = 1; // Next offset.
}
}
return internal::pload<PacketReturnType>(values);