code: def _leaky_relu(fp32_piggy_back=False):
      # refer to src/ATen/native/quantized/cpu/qrelu.cpp
      def _impl_fp32(inputs, _):
          alpha = inputs[1]
          output_scale = _expr.const(inputs[3])
          output_zero_point = _expr.const(inputs[4])
          input_scale = _expr.const(inputs[5])
          input_zero_point = _expr.const(inputs[6])
          dequant = relay.qnn.op.dequantize(
              inputs[0], input_scale, input_zero_point
          )
          dequantized = _op.nn.leaky_relu(dequant, alpha)
          return relay.qnn.op.quantize(
              dequantized,
              output_scale,
              output_zero_point,
              out_dtype="uint8",
          )
  
      def _impl_int8(inputs, _):
          alpha = inputs[1]
          output_scale = _expr.const(inputs[3])
          output_zero_point = _expr.const(inputs[4])
          input_scale = _expr.const(inputs[5])
          input_zero_point = _expr.const(inputs[6])
          return relay.qnn.op.leaky_relu(
              inputs[0],
              alpha,
              input_scale,
              input_zero_point,
              output_scale,
              output_zero_point,
          )
  
      def _impl(inputs, _):
          assert (
              len(inputs) == 7
          ), "Input quant params not found in op inputs"
          if fp32_piggy_back:
              return _impl_fp32(inputs, _)
          return _impl_int8(inputs, _)
  
      return _impl
  
imports: import numpy
  import tvm
  from tvm import relay
  from tvm.relay import expr
  from tvm.relay import op
  from tvm.relay.frontend.common import infer_shape
  from .common import logger
  from .pytorch_utils import is_version_greater_than
label_desc: Use image node_id 31 for calling a global function with example usage: _leaky_relu(fp32_piggy_back) and returns: _impl, relay, relay, _impl_int8, _impl_fp32