BinaryConnect
BinaryConnect copied to clipboard
Comparison between ".data.clone()" and ".data.copy_()"
Thank you for your code!
I have a question about LINE 26 and LINE33 in the binaryconnect.py
. I wonder why you choose two different functions ".data.clone()" and ".data.copy_()" in these lines?
I guess the "clone()" will create a new tensor with new address, while "copy_()" is a in-place operation, am I right?
I also wonder the Version of Pytorch that you implemented in this code.
Thank you again!
Hello,
You are right concerning the difference between clone and copy . I tested the code on Pythorch 0.4 and 1
@eghouti Hi, For self.saved_params, why use "clone" in BC.init and use "copy_" in BC.save_params ? Why choose two different approachs to store data for one list self.saved_params ?
Therefore, I guess the version of Torchvision you used is 0.2.2?