Skip to content

Commit d4b58c9

Browse files
Arm backend: Remove unused function build_rescale_conv_output (#14141)
Signed-off-by: Sebastian Larsson <[email protected]>
1 parent a89b858 commit d4b58c9

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

backends/arm/tosa/quant_utils.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
from typing import Any, Tuple
1313

1414
import serializer.tosa_serializer as ts # type: ignore
15-
import torch.fx
16-
import torch.fx.node
1715

1816
from executorch.backends.arm._passes.fold_qdq_with_annotated_qparams_pass import (
1917
get_input_qparams,
@@ -351,38 +349,3 @@ def build_rescale_from_int32(
351349
) # type: ignore[call-arg]
352350

353351
return
354-
355-
356-
""" Creates a TOSA rescale op based on conv2d parameters. """
357-
358-
359-
def build_rescale_conv_output(
360-
tosa_fb: Any,
361-
op: Any,
362-
output_name: str,
363-
output_type: Any,
364-
input_scale: list[float],
365-
weight_scale: list[float],
366-
output_scale: list[float],
367-
output_zp: list[int],
368-
tosa_spec=None,
369-
):
370-
# TODO add check to verify if this is a Per-channel quantization.
371-
post_conv2d_scale = [
372-
(inp * w) / out for inp, w, out in zip(input_scale, weight_scale, output_scale)
373-
]
374-
375-
# For TOSA v1.0 multipliers, shifts, input_zp and output_zp are now inputs
376-
# to the RESCALE op see: https://www.mlplatform.org/tosa/tosa_spec.html#_rescale
377-
build_rescale(
378-
tosa_fb=tosa_fb,
379-
scale=post_conv2d_scale,
380-
input_node=op,
381-
output_name=output_name,
382-
output_type=output_type,
383-
input_zp=[0],
384-
output_zp=output_zp,
385-
rounding_mode=RoundingMode.SINGLE_ROUND,
386-
per_channel=isinstance(weight_scale, torch.Tensor),
387-
) # type: ignore[call-arg]
388-
return

0 commit comments

Comments
 (0)