-
Notifications
You must be signed in to change notification settings - Fork 80
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
change "repeat" to "repeat_interleave" and "tile" uniformly #827
base: master
Are you sure you want to change the base?
Conversation
examples/opensora_pku/opensora/models/causalvideovae/model/modules/quant.py
Show resolved
Hide resolved
@@ -49,7 +49,7 @@ def transform_conditional_images(image_paths, H, W, random_crop=True, normalize= | |||
if normalize: | |||
|
|||
def image_norm(image): | |||
image = image.mean(dim=0, keepdim=True).repeat(3, 1, 1) | |||
image = image.mean(axis=0, keepdims=True).repeat(3, axis=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repeat(3, 1, 1) -> tile(3, 1, 1)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是numpy的mean和repeat,这里做了下参数修改。torch的repeat(3,1,1)和numpy的repeat(3,axis=0)对于(1, H, W)的image的生成结果是一样的。
there is nothing under "What does this PR do". |
What does this PR do?
Fixes # (issue)
Since
mindspore.Tensor.repeat
is different from thetorch.Tensor.repeat
for now, we check the original torch source code again and replace themindspore.Tensor.repeat
withmindspore.Tensor.repeat_interleave
ormindspore.Tensor.tile
according to the following alignment rules:torch.Tensor.repeat
->mindspore.Tensor.tile
torch.Tensor.repeat_interleave
->mindspore.Tensor.repeat_interleave
Before submitting
What's New
. Here are thedocumentation guidelines
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@xxx