carrascomj / carrascomj/shapels

`torch.cat`/`torch.stack` for static Sequential cases

Open
#32 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
15
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Docs: https://docs.pytorch.org/docs/stable/generated/torch.cat.html

Initial implementation should only tackle statically defined sequences (lists, tuples) at the call-site.

Tracking list comprehensions or variables mapping to a sequence is out-of-scope.

### Example

```python
def concat_emb(self, c3: F[T, "B F H3 W3"], embeddings: F[T, "B E"]) -> F[T, "B F H3*W3+E"]:
"""Concat c3 with embeddings."""
_, F, h_3, w_3 = c3.shape
# expand to concat: [B, E] -> [B, F, E]
embeddings = embeddings.unsqueeze(1).expand(-1, F, -1)
# this can be known statically since embeddings and c3 are known
c3_flat = torch.cat([c3.flatten(-2), embeddings], dim=-1)
return c3_flat
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked torch.cat documentation and the repository’s existing handling of torch calls. Implement support for statically defined lists and tuples at the call site for torch.cat and torch.stack; leave list comprehensions and variables that refer to sequences out of scope, and verify the provided example’s shapes are inferred.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch, rust
Domain
devtools, machine-learning
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.