I am also interested in this.
Same context - quantization.
The TF code can be seen here: https://github.com/ppwwyyxx/tensorpack/blob/master/examples/DoReFa-Net/dorefa.py#L20 40
What is the equivalent approach in Pytorch for this?