Skip to content

fix(reshape): support reshaping 1D Grassmann tensors to all-ones shapes - #73

Merged
gausshj merged 1 commit into
feature/simple-updatefrom
fix/reshape-with-one-dimension
Oct 30, 2025
Merged

fix(reshape): support reshaping 1D Grassmann tensors to all-ones shapes#73
gausshj merged 1 commit into
feature/simple-updatefrom
fix/reshape-with-one-dimension

Conversation

@gausshj

@gausshj gausshj commented Oct 29, 2025

Copy link
Copy Markdown
Collaborator
  • Add support for reshaping 1D Grassmann tensors to all-ones shapes
  • Add test cases for new feature
  • Raising a clear AssertionError if non-trivial dims remain after self dims are exhausted.

- Add support for reshaping 1D Grassmann tensors to all-ones shapes
- Add test cases for new feature
- Raising a clear AssertionError if non-trivial dims remain after self dims are exhausted.
@codecov

codecov Bot commented Oct 29, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@hzhangxyz hzhangxyz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

为什么要特殊处理 (1, ) 这个情况? (1, 1, 1, 1), (1, 1, 1) 这些不应该和他是类似的么?

return GrassmannTensor(_arrow=(), _edges=(), _tensor=tensor)

if new_shape == (1,) and int(self.tensor.numel()) == 1:
eo = self._calculate_even_odd()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

别用这个缩写的名字

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

为什么要特殊处理 (1, ) 这个情况? (1, 1, 1, 1), (1, 1, 1) 这些不应该和他是类似的么?

@gausshj
gausshj changed the base branch from main to feature/simple-update October 30, 2025 01:48
@gausshj
gausshj merged commit 1e63ab9 into feature/simple-update Oct 30, 2025
33 checks passed
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