eriklindernoren / PyTorch-GAN

PyTorch implementations of Generative Adversarial Networks.
MIT License
16.2k stars 4.05k forks source link

Error in dcgan.py ? #154

Open HuangZuShu opened 3 years ago

HuangZuShu commented 3 years ago

https://github.com/eriklindernoren/PyTorch-GAN/blob/36d3c77e5ff20ebe0aeefd322326a134a279b93e/implementations/dcgan/dcgan.py#L91 the right code should be as following ? ds_size = opt.img_size // (2 ** 4) instead of ds_size = opt.img_size // 2 ** 4

MathieuHaller commented 3 years ago

Correct me if I'm wrong, but I'm pretty sure the behaviors of the 2 implementations are the same.
The ** takes priority in both cases.

For example, no matter whether you do:
100//(5**2)
or
100//5**2

You'll get 4 in both cases in python.
However if you do:
(100//5)**2
you'll get 400, only in that case you get a different behavior.