Skip to content
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

how to calculate the flops for pixelshuffle operation? #67

Open
hcleung3325 opened this issue May 24, 2021 · 7 comments
Open

how to calculate the flops for pixelshuffle operation? #67

hcleung3325 opened this issue May 24, 2021 · 7 comments
Labels
question Further information is requested

Comments

@hcleung3325
Copy link

I have fit a model with pixelshuffle operation to this flops calculation.
However, it cannot calculate the flops in pixelshuffle layer.

PixelShuffle(0.0 M, 0.000% Params, 0.0 GMac, 0.000% MACs, upscale_factor=2)

Can anyone help?

@sovrasov sovrasov added the enhancement New feature or request label May 24, 2021
@hcleung3325
Copy link
Author

Hi sovrasov , may I know that would pixel shuffle consume floating point operation?
As I cannot find any equation or information is about the flops for pixel shuffle, I wonder if this layer is a floating point operation or not?
Thanks.

@sovrasov
Copy link
Owner

I've reviewed the original paper that introduced PixelShuffle and agree that it's rather a memory rearrangement operator, so the current behavior is correct.

@sovrasov sovrasov added question Further information is requested and removed enhancement New feature or request labels May 26, 2021
@hcleung3325
Copy link
Author

I've reviewed the original paper that introduced PixelShuffle and agree that it's rather a memory rearrangement operator, so the current behavior is correct.

Thanks for the clarifcation. Is that the memory rearrangement operator will not be considered as floating point operation?
Is that the memory rearrangement operator still consume computational power and time?

@sovrasov
Copy link
Owner

Yep, memory rearrangement always consumes time, but it is out of scope for flops metric. I'd rather keep the straightforward flops definition to avoid misunderstanding. For such operations like PixelShuffle or even ReLU we should think about a different metric.

@hcleung3325
Copy link
Author

Yep, memory rearrangement always consumes time, but it is out of scope for flops metric. I'd rather keep the straightforward flops definition to avoid misunderstanding. For such operations like PixelShuffle or even ReLU we should think about a different metric.

Thanks. As you said there is a paper that introduced PixelShuffle, may I have the name of it?

@sovrasov
Copy link
Owner

@hcleung3325
Copy link
Author

https://arxiv.org/abs/1609.05158

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants