BinaryNet.pytorch icon indicating copy to clipboard operation
BinaryNet.pytorch copied to clipboard

tensor.sign? no backward?

Open edwardzcl opened this issue 4 years ago • 4 comments

See https://github.com/itayhubara/BinaryNet.pytorch/blob/master/models/binarized_modules.py

image

I want to know what is the backward process of this function. Only use tensor.sign()? What is the backward values of it?

edwardzcl avatar Jul 09 '20 08:07 edwardzcl

since it uses tensor.data = Binarize(tensor.data.org) in the code, so PyTorch won't record the grad op in the graph, in other words, no need to worry about the backward op, it won't happen at all.

hainingfang avatar Sep 14 '21 13:09 hainingfang