From 9b4708094d8d85d17368e681009f1455b1430cb1 Mon Sep 17 00:00:00 2001 From: Sebastian Larsson Date: Wed, 22 Oct 2025 09:23:08 +0200 Subject: [PATCH] Arm backend: Remove pyre-unsafe from operators/ Pyre is no longer used. Signed-off-by: Sebastian Larsson Change-Id: Ib4be797e6ee65382c40dc3999321f04764e13a0f --- backends/arm/operators/__init__.py | 1 - backends/arm/operators/node_visitor.py | 1 - backends/arm/operators/op_abs.py | 1 - backends/arm/operators/op_add.py | 1 - backends/arm/operators/op_any.py | 1 - backends/arm/operators/op_avg_pool2d.py | 1 - backends/arm/operators/op_cat.py | 1 - backends/arm/operators/op_clamp.py | 1 - backends/arm/operators/op_constant_pad_nd.py | 1 - backends/arm/operators/op_cos.py | 1 - backends/arm/operators/op_eq.py | 1 - backends/arm/operators/op_erf.py | 1 - backends/arm/operators/op_exp.py | 1 - backends/arm/operators/op_ge.py | 1 - backends/arm/operators/op_gt.py | 1 - backends/arm/operators/op_index_select.py | 1 - backends/arm/operators/op_index_tensor.py | 1 - backends/arm/operators/op_le.py | 1 - backends/arm/operators/op_log.py | 1 - backends/arm/operators/op_lt.py | 1 - backends/arm/operators/op_max_pool2d.py | 1 - backends/arm/operators/op_maximum.py | 1 - backends/arm/operators/op_minimum.py | 1 - backends/arm/operators/op_mul.py | 1 - backends/arm/operators/op_neg.py | 1 - backends/arm/operators/op_permute.py | 1 - backends/arm/operators/op_pow.py | 1 - backends/arm/operators/op_reciprocal.py | 1 - backends/arm/operators/op_repeat.py | 1 - backends/arm/operators/op_rshift_tensor.py | 1 - backends/arm/operators/op_rsqrt.py | 1 - backends/arm/operators/op_sigmoid.py | 1 - backends/arm/operators/op_sin.py | 1 - backends/arm/operators/op_slice.py | 1 - backends/arm/operators/op_sub.py | 1 - backends/arm/operators/op_sum.py | 1 - backends/arm/operators/op_tanh.py | 1 - backends/arm/operators/op_to_dim_order_copy.py | 1 - backends/arm/operators/op_tosa_conv2d.py | 1 - backends/arm/operators/op_tosa_depthwise_conv2d.py | 2 -- backends/arm/operators/op_tosa_matmul.py | 1 - backends/arm/operators/op_tosa_rescale.py | 1 - backends/arm/operators/op_tosa_resize.py | 1 - backends/arm/operators/op_tosa_table.py | 1 - backends/arm/operators/op_tosa_transpose.py | 1 - backends/arm/operators/op_view.py | 1 - backends/arm/operators/ops_binary.py | 1 - backends/arm/operators/ops_identity.py | 1 - 48 files changed, 49 deletions(-) diff --git a/backends/arm/operators/__init__.py b/backends/arm/operators/__init__.py index e7812630f91..a180d0a6e86 100644 --- a/backends/arm/operators/__init__.py +++ b/backends/arm/operators/__init__.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from . import ( # noqa node_visitor, diff --git a/backends/arm/operators/node_visitor.py b/backends/arm/operators/node_visitor.py index c26929dab28..682c849fe80 100644 --- a/backends/arm/operators/node_visitor.py +++ b/backends/arm/operators/node_visitor.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe import json from typing import Any, Dict, List, Optional diff --git a/backends/arm/operators/op_abs.py b/backends/arm/operators/op_abs.py index 82e09f5f1d4..b5a58136395 100644 --- a/backends/arm/operators/op_abs.py +++ b/backends/arm/operators/op_abs.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List import tosa_serializer as ts diff --git a/backends/arm/operators/op_add.py b/backends/arm/operators/op_add.py index 24f43d62e56..2ae792f0ee1 100644 --- a/backends/arm/operators/op_add.py +++ b/backends/arm/operators/op_add.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_any.py b/backends/arm/operators/op_any.py index b024a01bd58..3cbdd91d2e4 100644 --- a/backends/arm/operators/op_any.py +++ b/backends/arm/operators/op_any.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, cast, List import tosa_serializer as ts diff --git a/backends/arm/operators/op_avg_pool2d.py b/backends/arm/operators/op_avg_pool2d.py index eb4bb743d5b..83f5f5d45f3 100644 --- a/backends/arm/operators/op_avg_pool2d.py +++ b/backends/arm/operators/op_avg_pool2d.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List import torch diff --git a/backends/arm/operators/op_cat.py b/backends/arm/operators/op_cat.py index 11b46038fbf..2cfa4720c3c 100644 --- a/backends/arm/operators/op_cat.py +++ b/backends/arm/operators/op_cat.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_clamp.py b/backends/arm/operators/op_clamp.py index 1d394f76dab..74722abe281 100644 --- a/backends/arm/operators/op_clamp.py +++ b/backends/arm/operators/op_clamp.py @@ -4,7 +4,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree -# pyre-unsafe from typing import Any, List, Tuple diff --git a/backends/arm/operators/op_constant_pad_nd.py b/backends/arm/operators/op_constant_pad_nd.py index f1f0f1bcb19..3bda87af5ed 100644 --- a/backends/arm/operators/op_constant_pad_nd.py +++ b/backends/arm/operators/op_constant_pad_nd.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_cos.py b/backends/arm/operators/op_cos.py index af97c0c95b3..e6039730b69 100644 --- a/backends/arm/operators/op_cos.py +++ b/backends/arm/operators/op_cos.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import List import tosa_serializer as ts diff --git a/backends/arm/operators/op_eq.py b/backends/arm/operators/op_eq.py index 1ffdda219a2..8fb789a9d01 100644 --- a/backends/arm/operators/op_eq.py +++ b/backends/arm/operators/op_eq.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_erf.py b/backends/arm/operators/op_erf.py index ef68c97ffcf..e642a4059fe 100644 --- a/backends/arm/operators/op_erf.py +++ b/backends/arm/operators/op_erf.py @@ -2,7 +2,6 @@ # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List import torch.fx diff --git a/backends/arm/operators/op_exp.py b/backends/arm/operators/op_exp.py index aef9ec7aca0..72e89b6906b 100644 --- a/backends/arm/operators/op_exp.py +++ b/backends/arm/operators/op_exp.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List import tosa_serializer as ts diff --git a/backends/arm/operators/op_ge.py b/backends/arm/operators/op_ge.py index 3b55d526282..5994cbc9c0f 100644 --- a/backends/arm/operators/op_ge.py +++ b/backends/arm/operators/op_ge.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_gt.py b/backends/arm/operators/op_gt.py index aa261ea06d7..859e5c236d7 100644 --- a/backends/arm/operators/op_gt.py +++ b/backends/arm/operators/op_gt.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_index_select.py b/backends/arm/operators/op_index_select.py index cf99f4efc50..db2488fa163 100644 --- a/backends/arm/operators/op_index_select.py +++ b/backends/arm/operators/op_index_select.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_index_tensor.py b/backends/arm/operators/op_index_tensor.py index af738033e1d..760e744923c 100644 --- a/backends/arm/operators/op_index_tensor.py +++ b/backends/arm/operators/op_index_tensor.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe import math from typing import Any, List diff --git a/backends/arm/operators/op_le.py b/backends/arm/operators/op_le.py index 086fd892a49..fb26b5b8606 100644 --- a/backends/arm/operators/op_le.py +++ b/backends/arm/operators/op_le.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_log.py b/backends/arm/operators/op_log.py index 254e02c9adf..565d6d56027 100644 --- a/backends/arm/operators/op_log.py +++ b/backends/arm/operators/op_log.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List import tosa_serializer as ts diff --git a/backends/arm/operators/op_lt.py b/backends/arm/operators/op_lt.py index ed831206e36..f5cf71420f4 100644 --- a/backends/arm/operators/op_lt.py +++ b/backends/arm/operators/op_lt.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_max_pool2d.py b/backends/arm/operators/op_max_pool2d.py index a068a2f49a7..1cab28f9153 100644 --- a/backends/arm/operators/op_max_pool2d.py +++ b/backends/arm/operators/op_max_pool2d.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List import torch diff --git a/backends/arm/operators/op_maximum.py b/backends/arm/operators/op_maximum.py index 463bee41a52..d3ab305ea3b 100644 --- a/backends/arm/operators/op_maximum.py +++ b/backends/arm/operators/op_maximum.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_minimum.py b/backends/arm/operators/op_minimum.py index 52125ed1f54..7f72d158d43 100644 --- a/backends/arm/operators/op_minimum.py +++ b/backends/arm/operators/op_minimum.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_mul.py b/backends/arm/operators/op_mul.py index 4b97d5e50b4..78b0b1b6675 100644 --- a/backends/arm/operators/op_mul.py +++ b/backends/arm/operators/op_mul.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_neg.py b/backends/arm/operators/op_neg.py index d025e8f0bd4..e0bb408e155 100644 --- a/backends/arm/operators/op_neg.py +++ b/backends/arm/operators/op_neg.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List import torch.fx diff --git a/backends/arm/operators/op_permute.py b/backends/arm/operators/op_permute.py index 26e66b40301..80ccfae04e6 100644 --- a/backends/arm/operators/op_permute.py +++ b/backends/arm/operators/op_permute.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_pow.py b/backends/arm/operators/op_pow.py index a46c6dd8df9..33cbc290d2c 100644 --- a/backends/arm/operators/op_pow.py +++ b/backends/arm/operators/op_pow.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_reciprocal.py b/backends/arm/operators/op_reciprocal.py index 10f9192a9c2..108a4fac0fb 100644 --- a/backends/arm/operators/op_reciprocal.py +++ b/backends/arm/operators/op_reciprocal.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List import torch diff --git a/backends/arm/operators/op_repeat.py b/backends/arm/operators/op_repeat.py index 49c45913614..21a8f8e1b04 100644 --- a/backends/arm/operators/op_repeat.py +++ b/backends/arm/operators/op_repeat.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any diff --git a/backends/arm/operators/op_rshift_tensor.py b/backends/arm/operators/op_rshift_tensor.py index 9fcd2b56381..0b5717aa403 100644 --- a/backends/arm/operators/op_rshift_tensor.py +++ b/backends/arm/operators/op_rshift_tensor.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_rsqrt.py b/backends/arm/operators/op_rsqrt.py index 259e34f129a..a86eaa40985 100644 --- a/backends/arm/operators/op_rsqrt.py +++ b/backends/arm/operators/op_rsqrt.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List import torch diff --git a/backends/arm/operators/op_sigmoid.py b/backends/arm/operators/op_sigmoid.py index 814158a1d32..908544ff00c 100644 --- a/backends/arm/operators/op_sigmoid.py +++ b/backends/arm/operators/op_sigmoid.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List import tosa_serializer as ts diff --git a/backends/arm/operators/op_sin.py b/backends/arm/operators/op_sin.py index ac0ae212e78..faa249917c3 100644 --- a/backends/arm/operators/op_sin.py +++ b/backends/arm/operators/op_sin.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import List import tosa_serializer as ts diff --git a/backends/arm/operators/op_slice.py b/backends/arm/operators/op_slice.py index 941f8d690c3..c5510493eae 100644 --- a/backends/arm/operators/op_slice.py +++ b/backends/arm/operators/op_slice.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_sub.py b/backends/arm/operators/op_sub.py index 52caa9d0f8a..f5f82679ca8 100644 --- a/backends/arm/operators/op_sub.py +++ b/backends/arm/operators/op_sub.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_sum.py b/backends/arm/operators/op_sum.py index 7be3e884275..91c37e25f43 100644 --- a/backends/arm/operators/op_sum.py +++ b/backends/arm/operators/op_sum.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_tanh.py b/backends/arm/operators/op_tanh.py index 0799628cd7d..c4603e90118 100644 --- a/backends/arm/operators/op_tanh.py +++ b/backends/arm/operators/op_tanh.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List import tosa_serializer as ts diff --git a/backends/arm/operators/op_to_dim_order_copy.py b/backends/arm/operators/op_to_dim_order_copy.py index c41431a1b6d..9d3aff83554 100644 --- a/backends/arm/operators/op_to_dim_order_copy.py +++ b/backends/arm/operators/op_to_dim_order_copy.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List import torch diff --git a/backends/arm/operators/op_tosa_conv2d.py b/backends/arm/operators/op_tosa_conv2d.py index 0e10867da7e..918db443ef9 100644 --- a/backends/arm/operators/op_tosa_conv2d.py +++ b/backends/arm/operators/op_tosa_conv2d.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe import tosa_serializer as ts """Provide a visitor for lowering 2D convolution to TOSA (INT/FP).""" diff --git a/backends/arm/operators/op_tosa_depthwise_conv2d.py b/backends/arm/operators/op_tosa_depthwise_conv2d.py index 1d1c317a0b8..78e6e4424cb 100644 --- a/backends/arm/operators/op_tosa_depthwise_conv2d.py +++ b/backends/arm/operators/op_tosa_depthwise_conv2d.py @@ -3,8 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe - """Provide a visitor for lowering 2D depthwise convolution to TOSA (INT/FP).""" import tosa_serializer as ts diff --git a/backends/arm/operators/op_tosa_matmul.py b/backends/arm/operators/op_tosa_matmul.py index e88ef9be55d..2281564a0c4 100644 --- a/backends/arm/operators/op_tosa_matmul.py +++ b/backends/arm/operators/op_tosa_matmul.py @@ -4,7 +4,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe """Provide a visitor for lowering batched matmul (BMM) to TOSA.""" from typing import Any, List diff --git a/backends/arm/operators/op_tosa_rescale.py b/backends/arm/operators/op_tosa_rescale.py index 26f27370bdd..75268938579 100644 --- a/backends/arm/operators/op_tosa_rescale.py +++ b/backends/arm/operators/op_tosa_rescale.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, cast, List diff --git a/backends/arm/operators/op_tosa_resize.py b/backends/arm/operators/op_tosa_resize.py index 60328a3b3ab..fb8e305839f 100644 --- a/backends/arm/operators/op_tosa_resize.py +++ b/backends/arm/operators/op_tosa_resize.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List import torch diff --git a/backends/arm/operators/op_tosa_table.py b/backends/arm/operators/op_tosa_table.py index 9572e49781f..11407517b6a 100644 --- a/backends/arm/operators/op_tosa_table.py +++ b/backends/arm/operators/op_tosa_table.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_tosa_transpose.py b/backends/arm/operators/op_tosa_transpose.py index 2159a67b285..bbd9252f8f8 100644 --- a/backends/arm/operators/op_tosa_transpose.py +++ b/backends/arm/operators/op_tosa_transpose.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List diff --git a/backends/arm/operators/op_view.py b/backends/arm/operators/op_view.py index c6f6e36b6e9..f13c386a5ee 100644 --- a/backends/arm/operators/op_view.py +++ b/backends/arm/operators/op_view.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, cast, List import torch diff --git a/backends/arm/operators/ops_binary.py b/backends/arm/operators/ops_binary.py index 360e15a0ad2..3e8cda76b5a 100644 --- a/backends/arm/operators/ops_binary.py +++ b/backends/arm/operators/ops_binary.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, Callable, List diff --git a/backends/arm/operators/ops_identity.py b/backends/arm/operators/ops_identity.py index 994b43a7c15..d570c52ed31 100644 --- a/backends/arm/operators/ops_identity.py +++ b/backends/arm/operators/ops_identity.py @@ -3,7 +3,6 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# pyre-unsafe from typing import Any, List