Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct Shape of scdl output matirx #708

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Intron7
Copy link

@Intron7 Intron7 commented Feb 27, 2025

This fixes the size of the output matrix for scdl.
It also enables users to return a dense array

@@ -27,14 +29,19 @@ def collate_sparse_matrix_batch(batch: list[torch.Tensor]) -> torch.Tensor:
Returns:
The tensors collated into a CSR (Compressed Sparse Row) Format.
"""
n_features = batch[0][1][0]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment explaining the hardcoded indexes?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment

@@ -240,6 +240,7 @@ def __init__(
paginated_load_cutoff: int = 10_000,
load_block_row_size: int = 1_000_000,
feature_index_name="feature_id",
return_padded: bool = False,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High level, how does the code know what the pad size is? Or max size to pad to?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This uses the return get_row_padded for __getitem__

Signed-off-by: Intron7 <severin.dicks@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants