Torch dataloader utils
collate_sparse_matrix_batch(batch)
Collate function to create a batch out of sparse tensors.
This is necessary to collate sparse matrices of various lengths.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
batch
|
list[Tensor]
|
A list of Tensors to collate into a batch. |
required |
Returns:
Type | Description |
---|---|
Tensor
|
The tensors collated into a CSR (Compressed Sparse Row) Format. |
Source code in bionemo/scdl/util/torch_dataloader_utils.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|