code: def transform(self, model, node):
      # Compute the required precision and update the variables
      # Number of bits for output is log2 of number of input nodes
      # Since this is the number of uint<1>'s which are summed
      nbits = int(np.ceil(np.log2(node.attributes["n_in"])) + 2)
      out_type = IntegerPrecisionType(width=nbits)
      accum_t = NamedType(f"layer{node.index}_accum_t", out_type)
      node.set_attr("accum_t", accum_t)
      out_var = node.get_output_variable()
      out_var.type.precision = out_type
  
      quantized_data = None
      quantized_precision = None
      quantizer = node.get_attr("weight_quantizer")
      if quantizer.__class__.__name__ == "BinaryQuantizer":
          quantized_precision = XnorPrecisionType()
      elif quantizer.__class__.__name__ == "TernaryQuantizer":
          quantized_precision = IntegerPrecisionType(width=2)
      else:
          print(
              f"WARNING: Unknown quantizer - {quantizer.__class__.__name__}. Bailing out"
          )
          return False
      quantizer.bits = quantized_precision.width
      quantizer.hls_type = quantized_precision
      quantized_data = quantizer(node.weights["weight"].data)
  
      weights = node.weights["weight"]
      weights.data = quantized_data
      weights.type.name = f"weight{node.index}_t"
      weights.update_precision(quantized_precision)
  
      bias = node.weights["bias"]
      bias.data = np.zeros(shape=(node.get_attr("n_out")))
      bias.type.name = f"bias{node.index}_t"
      bias.nzeros = 0
      bias.update_precision(quantized_precision)
  
      # If followed by the BatchNormalizationBinaryTanh, update its input
      # Also requantise the weights
      bd_out_nodes = node.get_output_nodes()
      for out_node in bd_out_nodes:
          if isinstance(out_node, BatchNormalizationQuantizedTanh):
              var_names = []
              if quantizer.__class__.__name__ == "BinaryQuantizer":
                  var_names.append("threshold")
              elif quantizer.__class__.__name__ == "TernaryQuantizer":
                  var_names.append("threshold_hi")
                  var_names.append("threshold_lo")
              for var_name in var_names:
                  threshold_var = out_node.weights[var_name]
                  threshold_var.update_precision(out_type)
                  threshold_var.data = np.floor(threshold_var.data)
  
      return False
  
imports: import numpy
  from hls4ml.backends.fpga.fpga_layers import BatchNormalizationQuantizedTanh
  from hls4ml.backends.template import FunctionCallTemplate, LayerConfigTemplate
  from hls4ml.model.layers import BatchNormalization, register_layer
  from hls4ml.model.optimizer import OptimizerPass
  from hls4ml.model.types import IntegerPrecisionType, NamedType, XnorPrecisionType
label_desc: Use image node_id 2 for calling the QuantizeDenseOutput obj's underlying member method code with example usage: obj.transform(model, node) and returns: False, False