diff --git a/backends/arm/_passes/annotate_decomposed_matmul.py b/backends/arm/_passes/annotate_decomposed_matmul.py index 3feb0a0e051..c45cd63f9cf 100644 --- a/backends/arm/_passes/annotate_decomposed_matmul.py +++ b/backends/arm/_passes/annotate_decomposed_matmul.py @@ -4,6 +4,8 @@ # 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 itertools from typing import List diff --git a/backends/arm/_passes/fold_qdq_with_annotated_qparams_pass.py b/backends/arm/_passes/fold_qdq_with_annotated_qparams_pass.py index 29791940d52..da2bd28a176 100644 --- a/backends/arm/_passes/fold_qdq_with_annotated_qparams_pass.py +++ b/backends/arm/_passes/fold_qdq_with_annotated_qparams_pass.py @@ -4,6 +4,8 @@ # 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 copy from typing import cast, Dict, Set, Tuple diff --git a/backends/arm/_passes/fuse_batchnorm2d_pass.py b/backends/arm/_passes/fuse_batchnorm2d_pass.py index 6a5ece2e446..8675b340af4 100644 --- a/backends/arm/_passes/fuse_batchnorm2d_pass.py +++ b/backends/arm/_passes/fuse_batchnorm2d_pass.py @@ -3,6 +3,8 @@ # 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 torch from executorch.exir import ExportedProgram from executorch.exir.dialects._ops import ops as exir_ops diff --git a/backends/arm/_passes/fuse_quantized_activation_pass.py b/backends/arm/_passes/fuse_quantized_activation_pass.py index 4eccea1a143..3ac9f5cbb98 100644 --- a/backends/arm/_passes/fuse_quantized_activation_pass.py +++ b/backends/arm/_passes/fuse_quantized_activation_pass.py @@ -3,6 +3,8 @@ # 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 torch from executorch.backends.arm.tosa_quant_utils import q_op from executorch.exir.dialects._ops import ops as exir_ops diff --git a/backends/arm/_passes/insert_table_ops.py b/backends/arm/_passes/insert_table_ops.py index b500540ffb7..ada4d646c06 100644 --- a/backends/arm/_passes/insert_table_ops.py +++ b/backends/arm/_passes/insert_table_ops.py @@ -4,6 +4,8 @@ # 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 Callable, Dict import torch diff --git a/backends/arm/_passes/mm_to_bmm_pass.py b/backends/arm/_passes/mm_to_bmm_pass.py index c0c0d67c0bc..602d4a007a6 100644 --- a/backends/arm/_passes/mm_to_bmm_pass.py +++ b/backends/arm/_passes/mm_to_bmm_pass.py @@ -4,6 +4,8 @@ # 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 torch from executorch.backends.arm._passes.arm_pass_utils import ( create_node, diff --git a/backends/arm/operator_support/right_shift_support.py b/backends/arm/operator_support/right_shift_support.py index bf548982b74..c0280919693 100644 --- a/backends/arm/operator_support/right_shift_support.py +++ b/backends/arm/operator_support/right_shift_support.py @@ -3,6 +3,8 @@ # 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 logging diff --git a/backends/arm/operators/op_clamp.py b/backends/arm/operators/op_clamp.py index 486da27c9a3..7c4ad8682fa 100644 --- a/backends/arm/operators/op_clamp.py +++ b/backends/arm/operators/op_clamp.py @@ -4,6 +4,8 @@ # 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 import serializer.tosa_serializer as ts # type: ignore diff --git a/backends/arm/operators/op_rshift.py b/backends/arm/operators/op_rshift.py index ac61cca6a98..938009938e0 100644 --- a/backends/arm/operators/op_rshift.py +++ b/backends/arm/operators/op_rshift.py @@ -4,6 +4,8 @@ # 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 serializer.tosa_serializer as ts # type: ignore diff --git a/backends/arm/util/arm_model_evaluator.py b/backends/arm/util/arm_model_evaluator.py index e13f9c4df03..c371d794376 100644 --- a/backends/arm/util/arm_model_evaluator.py +++ b/backends/arm/util/arm_model_evaluator.py @@ -4,6 +4,8 @@ # 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 logging import os import random diff --git a/backends/cadence/aot/fuse_ops.py b/backends/cadence/aot/fuse_ops.py index c4f63c5b926..34d3447713a 100644 --- a/backends/cadence/aot/fuse_ops.py +++ b/backends/cadence/aot/fuse_ops.py @@ -1,5 +1,7 @@ # (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. +# pyre-unsafe + # This file contains all the functions that fuse ops in the fx graph. diff --git a/backends/cadence/aot/tests/test_fusion_ops_passes.py b/backends/cadence/aot/tests/test_fusion_ops_passes.py index e0f90ed46fc..a1467dd2570 100644 --- a/backends/cadence/aot/tests/test_fusion_ops_passes.py +++ b/backends/cadence/aot/tests/test_fusion_ops_passes.py @@ -1,5 +1,7 @@ # (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. +# pyre-unsafe + import unittest diff --git a/backends/cadence/aot/tests/test_memory_passes.py b/backends/cadence/aot/tests/test_memory_passes.py index f1f01ea9296..53f173b4ae3 100644 --- a/backends/cadence/aot/tests/test_memory_passes.py +++ b/backends/cadence/aot/tests/test_memory_passes.py @@ -1,5 +1,7 @@ # (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. +# pyre-unsafe + import logging import math import unittest diff --git a/backends/cadence/aot/tests/test_remove_ops_passes.py b/backends/cadence/aot/tests/test_remove_ops_passes.py index 231096c3ab4..1b7e6bde166 100644 --- a/backends/cadence/aot/tests/test_remove_ops_passes.py +++ b/backends/cadence/aot/tests/test_remove_ops_passes.py @@ -1,5 +1,7 @@ # (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. +# pyre-unsafe + import unittest from typing import cast, Tuple diff --git a/backends/cadence/aot/tests/test_reorder_ops_passes.py b/backends/cadence/aot/tests/test_reorder_ops_passes.py index fa5f13917a3..e998a4aa89f 100644 --- a/backends/cadence/aot/tests/test_reorder_ops_passes.py +++ b/backends/cadence/aot/tests/test_reorder_ops_passes.py @@ -1,5 +1,7 @@ # (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. +# pyre-unsafe + import unittest diff --git a/backends/cadence/aot/tests/test_replace_ops_passes.py b/backends/cadence/aot/tests/test_replace_ops_passes.py index 1282e4e9b25..56160b380bf 100644 --- a/backends/cadence/aot/tests/test_replace_ops_passes.py +++ b/backends/cadence/aot/tests/test_replace_ops_passes.py @@ -1,5 +1,7 @@ # (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. +# pyre-unsafe + import unittest from typing import Any, Callable, cast, List, Optional, Sequence, Tuple, Union diff --git a/backends/cadence/aot/tests/test_simplify_ops_passes.py b/backends/cadence/aot/tests/test_simplify_ops_passes.py index 347a48b9299..bab607922c1 100644 --- a/backends/cadence/aot/tests/test_simplify_ops_passes.py +++ b/backends/cadence/aot/tests/test_simplify_ops_passes.py @@ -1,5 +1,7 @@ # (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. +# pyre-unsafe + import unittest from typing import cast, Optional, Tuple diff --git a/backends/cadence/runtime/runtime.py b/backends/cadence/runtime/runtime.py index 0268931c409..4d1c876bcdb 100644 --- a/backends/cadence/runtime/runtime.py +++ b/backends/cadence/runtime/runtime.py @@ -4,6 +4,8 @@ # 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 logging import numbers diff --git a/backends/cadence/runtime/utils.py b/backends/cadence/runtime/utils.py index 0a85b6dd618..6c4f65feb17 100644 --- a/backends/cadence/runtime/utils.py +++ b/backends/cadence/runtime/utils.py @@ -4,6 +4,8 @@ # 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 logging import typing diff --git a/examples/cadence/operators/test_add_op.py b/examples/cadence/operators/test_add_op.py index 7799fe624bb..c940be3e6e6 100644 --- a/examples/cadence/operators/test_add_op.py +++ b/examples/cadence/operators/test_add_op.py @@ -1,5 +1,7 @@ # (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. +# pyre-unsafe + import unittest from typing import Tuple diff --git a/examples/cadence/operators/test_g3_ops.py b/examples/cadence/operators/test_g3_ops.py index d557c5a3e81..c33290416be 100644 --- a/examples/cadence/operators/test_g3_ops.py +++ b/examples/cadence/operators/test_g3_ops.py @@ -1,3 +1,4 @@ +# pyre-unsafe import unittest from typing import Any, cast, List, OrderedDict, Tuple diff --git a/examples/cadence/operators/test_quantized_conv1d_op.py b/examples/cadence/operators/test_quantized_conv1d_op.py index e2457077b2a..06ae03e6cfd 100644 --- a/examples/cadence/operators/test_quantized_conv1d_op.py +++ b/examples/cadence/operators/test_quantized_conv1d_op.py @@ -4,6 +4,8 @@ # 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 + # Example script for exporting simple models to flatbuffer import logging diff --git a/examples/cadence/operators/test_quantized_linear_op.py b/examples/cadence/operators/test_quantized_linear_op.py index 583359cdc69..c220bf62610 100644 --- a/examples/cadence/operators/test_quantized_linear_op.py +++ b/examples/cadence/operators/test_quantized_linear_op.py @@ -4,6 +4,8 @@ # 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 + # Example script for exporting simple models to flatbuffer import logging