No, read the documentation, it differs depending on the device you are working. You should initiate all you label with equal length, perhaps by padding the them. The class acknowledges the length of each target through the “target_lengths” argument which should contain the length of each target in the batch.