Heterodata to Seq#518
Closed
yliu2-sc wants to merge 7 commits intoyliu2/positional_encoding_transformfrom
Closed
Conversation
zfan3-sc
reviewed
Mar 12, 2026
gigl/transforms/graph_transformer.py
Outdated
|
|
||
| def __init__( | ||
| self, | ||
| batch_size: int, |
Collaborator
There was a problem hiding this comment.
Does this transform require all batches to share the same batch size? For test batches, since we want to include all test samples, the last batch can contain less samples, will it still work?
zfan3-sc
reviewed
Mar 17, 2026
| reachable.indices(), | ||
| torch.ones(reachable._nnz(), device=device, dtype=torch.float), | ||
| size=(batch_size, num_nodes), | ||
| ).coalesce() |
Collaborator
There was a problem hiding this comment.
It seems it does no harm if we skip the coalesce here? For positional encoding, if the user only plans to use hop distances w.r.t anchors, they can grab that information here, and do not need to run the hop distance transform that produces n x n sparse matrices on the whole graph.
zfan3-sc
reviewed
Mar 17, 2026
| max_seq_len: Maximum sequence length (neighbors beyond this are truncated). | ||
| anchor_node_type: The node type of anchor nodes. | ||
| feature_dim: Output feature dimension. If None, inferred from data. | ||
| If provided and different from input, features are projected. |
Collaborator
There was a problem hiding this comment.
I don't see the projection logic?
Collaborator
Author
|
Move to combine changes with #537 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope of work done
Where is the documentation for this feature?: N/A
Did you add automated tests or write a test plan?
Updated Changelog.md? NO
Ready for code review?: NO