(tensors: Sequence[torch.Tensor])
| 122 | |
| 123 | |
| 124 | def _prepare_input_ids(tensors: Sequence[torch.Tensor]): |
| 125 | tensors = [torch.flatten(t) for t in tensors] |
| 126 | data = torch.concat(tensors) |
| 127 | row_lengths = [t.size(0) for t in tensors] |
| 128 | row_lengths = torch.tensor(row_lengths, |
| 129 | dtype=torch.int32, |
| 130 | device=data.device) |
| 131 | return (data, row_lengths) |
| 132 | |
| 133 | |
| 134 | def CUASSERT(cuda_ret): |
no test coverage detected