After implementing tf_while and TensorArray, my code seems to throwing a ResourceExhaused error. However, this is quite surprising as I am dealing with a very small amount