the output is:
Epoch: 001/200 | Batch 0000/0343 | Cost: 38.0783
memory allocated after 369382912
memory allocated before 346285056
memory allocated after 369382912
memory allocated before 346285056
memory allocated after 369382912
memory allocated before 346285056
memory allocated after 369382912
memory allocated before 346285056
memory allocated after 369382912
memory allocated before 346285056
memory allocated after 369382912
and this repeated for all epochs …so I found that the used memory  is almost constant during each iteration. in the other side the run stopped at epoch 17 with a new error   :Screenshot from 2020-10-08 14-32-15786×527 93.4 KB