class_docstr: Quantizer using the DoReFa scheme, as defined in:
  Zhou et al., DoReFa-Net: Training Low Bitwidth Convolutional Neural Networks with Low Bitwidth Gradients
  (https://arxiv.org/abs/1606.06160)
code: def quantize_weight(self, wrapper, **kwargs):
      weight = copy.deepcopy(wrapper.module.old_weight.data)
      weight_bits = get_bits_length(wrapper.config, "weight")
      weight = weight.tanh()
      weight = weight / (2 * weight.abs().max()) + 0.5
      weight = self.quantize(weight, weight_bits)
      weight = 2 * weight - 1
      wrapper.module.weight = weight
      # wrapper.module.weight.data = weight
      return weight
  
imports: import logging
  import copy
  import torch
  from schema import Schema, And, Or, Optional
  from ..utils.config_validation import CompressorSchema
  from ..compressor import Quantizer, QuantGrad, QuantType
label_desc: Use image node_id 3 for calling the DoReFaQuantizer obj's underlying member method code with example usage: obj.quantize_weight(wrapper) and returns: weight