class_docstr: OptimizerPass for extracting alpha "scale" from QKeras quantized layer.
  The weights of the Q{Dense, Conv} layer are scaled to the common data type,
  and an 'ApplyAlpha' layer is inserted to reapply the scale.
class_docstr_tok: ["OptimizerPass","for","extracting","alpha","``","scale","''","from","QKeras","quantized","layer",".","The","weights","of","the","Q","{","Dense",",","Conv","}","layer","are","scaled","to","the","common","data","type",",","and","an","'ApplyAlpha","'","layer","is","inserted","to","reapply","the","scale","."]
code: def match(self, node):
      q_layer = node.class_name in [
          "Dense",
          "Conv1D",
          "Conv2D",
          "Conv2DBatchnorm",
      ]
      has_w_quant = node.get_attr("weight_quantizer") is not None
      has_b_quant = node.get_attr("bias_quantizer") is not None
      has_w_alpha, has_b_alpha = False, False
      if has_w_quant:
          if hasattr(node.get_attr("weight_quantizer"), "alpha"):
              w_alpha = node.get_attr("weight_quantizer").alpha
              has_w_alpha = w_alpha != 1 and w_alpha is not None
          else:
              has_w_alpha = False
      if has_b_quant:
          if hasattr(node.get_attr("bias_quantizer"), "alpha"):
              b_alpha = node.get_attr("bias_quantizer").alpha
              has_b_alpha = b_alpha != 1 and b_alpha is not None
          else:
              has_b_alpha = False
      is_match = q_layer and (
          (has_w_quant and has_w_alpha) or (has_b_quant and has_b_alpha)
      )
      return is_match
  
imports: import numpy
  import tensorflow
  from hls4ml.model.layers import BatchNormalization, register_layer
  from hls4ml.model.optimizer import ConfigurableOptimizerPass, OptimizerPass, register_pass
  from hls4ml.model.types import FixedPrecisionType, IntegerPrecisionType, NamedType, QKerasPO2Quantizer
label_desc: Use image node_id 1 for calling the QKerasFactorizeAlpha obj's underlying member method code with example usage: obj.match(node) and returns: is_match