Hi!
Sorry for the late reply. My error is that I was using a too high max_sample_length for my attention mechanism and that was causing a spike on the 10th iteration (decided by a random int, but since I had a seed this was happening always on 10th) to allocate memory out of what was really needed. Once I solved that it works as expected now