Skip to content

Add support for trivial edges in reshape function - #64

Merged
hzhangxyz merged 9 commits into
mainfrom
dev/add-one-dimensional-edge-in-reshape
Sep 2, 2025
Merged

Add support for trivial edges in reshape function#64
hzhangxyz merged 9 commits into
mainfrom
dev/add-one-dimensional-edge-in-reshape

Conversation

@hzhangxyz

Copy link
Copy Markdown
Member

No description provided.

@hzhangxyz
hzhangxyz requested a review from msg-bq August 31, 2025 04:07
@codecov

codecov Bot commented Aug 31, 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 force-pushed the dev/add-one-dimensional-edge-in-reshape branch from 44d1d46 to ad95164 Compare August 31, 2025 04:14
@hzhangxyz
hzhangxyz force-pushed the dev/add-one-dimensional-edge-in-reshape branch from ad95164 to f9535e0 Compare August 31, 2025 04:15
@hzhangxyz hzhangxyz linked an issue Aug 31, 2025 that may be closed by this pull request
merging = True
if total < self.tensor.shape[cursor_self]:
merging = False
if merging:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这里的merging会不会出现没有定义的bug

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

看上文,merging一定会被定义的

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

这里主要是因为,前后edge不一样大的话,我可以很轻松判断是在merging还是splitting,但是相等的时候比较麻烦。但是我也不能直接无脑认为没有任何变化,比如 (1, 3), (0, 1) <-> (3, 1) 这种情况,正向是merging,反向是splitting。所以我先检查了是否前后两个边真的一样,如果一样直接先处理了,处理后直接continue,如果不是的话,我预期应该是这种喊 (0, 1) 的情况,用前面那个while循环在self中检查后面是否有(0, 1) 边有的话就merging,没有的话就splitting。如果我的预期是错的,用户输入不合法,他无论走merging还是splitting后面都会报错。

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

好的

@hzhangxyz
hzhangxyz force-pushed the dev/add-one-dimensional-edge-in-reshape branch from f3ba170 to aab9668 Compare September 2, 2025 02:40
@hzhangxyz
hzhangxyz merged commit d940186 into main Sep 2, 2025
33 checks passed
@hzhangxyz hzhangxyz mentioned this pull request Sep 2, 2025
13 tasks
Comment thread grassmann_tensor/tensor.py
@msg-bq

msg-bq commented Sep 2, 2025

Copy link
Copy Markdown

咦晚了一步哈哈哈哈

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.

reshape need more tests.

3 participants