Can CTCLoss use multi-gpu?

I tried to develop mult-gpu CRNN with CTCLoss, when modified code with DataParallel and execute train code and got this error:

Traceback (most recent call last):
File “”, line 373, in
File “”, line 85, in main
train(model, train_dataloader, criterion, optimizer, epoch, scaler, writer)
File “”, line 230, in train
loss = criterion(output_log_probs, target, images_lengths, target_length)
File “/home/gpudev/miniconda3/envs/gpu38/lib/python3.8/site-packages/torch/nn/modules/”, line 1110, in _call_impl
return forward_call(*input, **kwargs)
File “/home/gpudev/miniconda3/envs/gpu38/lib/python3.8/site-packages/torch/nn/modules/”, line 1743, in forward
return F.ctc_loss(log_probs, targets, input_lengths, target_lengths, self.blank, self.reduction,
File “/home/gpudev/miniconda3/envs/gpu38/lib/python3.8/site-packages/torch/nn/”, line 2599, in ctc_loss
return torch.ctc_loss(
RuntimeError: input_lengths must be of size batch_size

But it was not occured when do with single gpu…I cannot understand about it well

I hope it was just my fault but other projects are getting same issue (and it does not work for me, too) :

So I want to know that CTCLoss can use with DataParallel or other way with 2 or more gpus and how to set data with