It looks like you’re trying to put your whole training dataset onto the GPU memory. Networks are usually trained using batches of sizes: 16, 32, 64, … – depending on your GPU memory, but also other factors; and it doesn’t have to be 2^x values either :).
You might want to use batches, and only put each batch onto the GPU. Something like
for i in range(epochs):
    for X_batch, Y_batch in get_next_batch(X_train_tensor, Y_train_tensor):
        X_batch, Y_batch = X_batch.cuda(), Y_batch.cuda()
        Y_batch_pred = model(X_batch)

get_next_batch() is just a placeholder function that creates the batches.