Could you replace the indexing of your input tensors by:
X_cur = X[train_idx:train_idx + ARG.batch_size, :].detach()
Y_cur = Y[train_idx:train_idx + ARG.batch_size, :].detach()

Also all the del, gc.collect() and empty_cache are useless and will only slow down your program.