terminator.models.layers.utils.pad_sequence_12¶
- terminator.models.layers.utils.pad_sequence_12(sequences, padding_value=0)[source]¶
Given a sequence of tensors, batch them together by pads both dims 1 and 2 to max length.
- Parameters:
sequences (list of torch.Tensor) – Sequence of tensors with number of axes N >= 2
padding value (int, default=0) – What value to pad the tensors with
- Returns:
out_tensor – Batched tensor with shape (n_batch, max_dim1, max_dim2, …)
- Return type:
torch.Tensor