diff --git a/fvcore/__init__.py b/fvcore/__init__.py index 1d78872..4fcde7e 100644 --- a/fvcore/__init__.py +++ b/fvcore/__init__.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + # This line will be programatically read/write by setup.py. # Leave them at the bottom of this file and don't touch them. __version__ = "0.1.6" diff --git a/fvcore/common/__init__.py b/fvcore/common/__init__.py index 5c7f19c..5276b67 100644 --- a/fvcore/common/__init__.py +++ b/fvcore/common/__init__.py @@ -1 +1,3 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +# pyre-strict diff --git a/fvcore/common/benchmark.py b/fvcore/common/benchmark.py index 6bc3b8e..d624253 100644 --- a/fvcore/common/benchmark.py +++ b/fvcore/common/benchmark.py @@ -1,4 +1,6 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +# pyre-strict # pyre-ignore-all-errors[2,3] import sys import time diff --git a/fvcore/common/checkpoint.py b/fvcore/common/checkpoint.py index 5f87a03..ef86e81 100644 --- a/fvcore/common/checkpoint.py +++ b/fvcore/common/checkpoint.py @@ -1,4 +1,6 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +# pyre-strict # pyre-ignore-all-errors[2,3,58] import logging diff --git a/fvcore/common/config.py b/fvcore/common/config.py index 3882b09..cef5ba9 100644 --- a/fvcore/common/config.py +++ b/fvcore/common/config.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import logging import os from typing import Any, Callable, Dict, IO, List, Union diff --git a/fvcore/common/download.py b/fvcore/common/download.py index e7b1a4b..82c0cb1 100644 --- a/fvcore/common/download.py +++ b/fvcore/common/download.py @@ -1,4 +1,6 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +# pyre-strict from iopath.common.download import download diff --git a/fvcore/common/file_io.py b/fvcore/common/file_io.py index 31250e1..ec39790 100644 --- a/fvcore/common/file_io.py +++ b/fvcore/common/file_io.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import logging import os import tempfile diff --git a/fvcore/common/history_buffer.py b/fvcore/common/history_buffer.py index ae6ecd3..3cae8bc 100644 --- a/fvcore/common/history_buffer.py +++ b/fvcore/common/history_buffer.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + from typing import List, Optional, Tuple import numpy as np diff --git a/fvcore/common/param_scheduler.py b/fvcore/common/param_scheduler.py index f95350b..9042981 100644 --- a/fvcore/common/param_scheduler.py +++ b/fvcore/common/param_scheduler.py @@ -1,3 +1,4 @@ +# pyre-strict import bisect import math from typing import List, Optional, Sequence, Union diff --git a/fvcore/common/registry.py b/fvcore/common/registry.py index a0ae0f1..5a6634c 100644 --- a/fvcore/common/registry.py +++ b/fvcore/common/registry.py @@ -1,4 +1,6 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved + +# pyre-strict # pyre-ignore-all-errors[2,3] from typing import Any, Dict, Iterable, Iterator, Tuple diff --git a/fvcore/common/timer.py b/fvcore/common/timer.py index 3de4a16..6bf3e8a 100644 --- a/fvcore/common/timer.py +++ b/fvcore/common/timer.py @@ -1,6 +1,8 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # -*- coding: utf-8 -*- +# pyre-strict + from time import perf_counter from typing import Optional diff --git a/fvcore/nn/__init__.py b/fvcore/nn/__init__.py index e00306e..34f6631 100644 --- a/fvcore/nn/__init__.py +++ b/fvcore/nn/__init__.py @@ -1,4 +1,6 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +# pyre-ignore-all-errors from .activation_count import activation_count, ActivationCountAnalysis from .flop_count import flop_count, FlopCountAnalysis from .focal_loss import ( diff --git a/fvcore/nn/activation_count.py b/fvcore/nn/activation_count.py index 6ce543f..1983b41 100644 --- a/fvcore/nn/activation_count.py +++ b/fvcore/nn/activation_count.py @@ -1,4 +1,6 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +# pyre-strict # pyre-ignore-all-errors[2,33] from collections import defaultdict diff --git a/fvcore/nn/distributed.py b/fvcore/nn/distributed.py index 4852d07..a726745 100644 --- a/fvcore/nn/distributed.py +++ b/fvcore/nn/distributed.py @@ -1,3 +1,4 @@ +# pyre-strict from typing import List, Tuple import torch diff --git a/fvcore/nn/flop_count.py b/fvcore/nn/flop_count.py index ac21f61..aa6c606 100644 --- a/fvcore/nn/flop_count.py +++ b/fvcore/nn/flop_count.py @@ -1,4 +1,6 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +# pyre-strict # pyre-ignore-all-errors[2,33] from collections import defaultdict diff --git a/fvcore/nn/focal_loss.py b/fvcore/nn/focal_loss.py index 23b3f71..ec48190 100644 --- a/fvcore/nn/focal_loss.py +++ b/fvcore/nn/focal_loss.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import torch from torch.nn import functional as F diff --git a/fvcore/nn/giou_loss.py b/fvcore/nn/giou_loss.py index 377358d..6ba14e8 100644 --- a/fvcore/nn/giou_loss.py +++ b/fvcore/nn/giou_loss.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import torch diff --git a/fvcore/nn/jit_analysis.py b/fvcore/nn/jit_analysis.py index d2cf61f..0d815ef 100644 --- a/fvcore/nn/jit_analysis.py +++ b/fvcore/nn/jit_analysis.py @@ -1,4 +1,6 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved + +# pyre-strict # pyre-ignore-all-errors[2,33] import logging diff --git a/fvcore/nn/jit_handles.py b/fvcore/nn/jit_handles.py index 747205c..a498f82 100644 --- a/fvcore/nn/jit_handles.py +++ b/fvcore/nn/jit_handles.py @@ -1,4 +1,6 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved + +# pyre-strict # pyre-ignore-all-errors[2,3,16,33,6,23] # NOTE: most Any type in this file should be torch._C.Value - which was not yet annotated. # pyre also doesn't work well with many Optional in this file diff --git a/fvcore/nn/parameter_count.py b/fvcore/nn/parameter_count.py index b5a3193..07d2628 100644 --- a/fvcore/nn/parameter_count.py +++ b/fvcore/nn/parameter_count.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# pyre-strict + import typing from collections import defaultdict diff --git a/fvcore/nn/precise_bn.py b/fvcore/nn/precise_bn.py index 012fcc5..ff184f9 100644 --- a/fvcore/nn/precise_bn.py +++ b/fvcore/nn/precise_bn.py @@ -1,4 +1,6 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +# pyre-strict # pyre-ignore-all-errors[2,6,16] import itertools diff --git a/fvcore/nn/print_model_statistics.py b/fvcore/nn/print_model_statistics.py index 5c45d28..b04ea43 100644 --- a/fvcore/nn/print_model_statistics.py +++ b/fvcore/nn/print_model_statistics.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + from collections import defaultdict from typing import Any, Dict, Iterable, List, Optional, Set, Tuple diff --git a/fvcore/nn/smooth_l1_loss.py b/fvcore/nn/smooth_l1_loss.py index 9e25db6..e8bf43d 100644 --- a/fvcore/nn/smooth_l1_loss.py +++ b/fvcore/nn/smooth_l1_loss.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import torch diff --git a/fvcore/nn/squeeze_excitation.py b/fvcore/nn/squeeze_excitation.py index 42227d4..f50745a 100644 --- a/fvcore/nn/squeeze_excitation.py +++ b/fvcore/nn/squeeze_excitation.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + from typing import Optional import torch diff --git a/fvcore/nn/weight_init.py b/fvcore/nn/weight_init.py index b6444bf..10c24ff 100644 --- a/fvcore/nn/weight_init.py +++ b/fvcore/nn/weight_init.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import torch.nn as nn diff --git a/fvcore/transforms/__init__.py b/fvcore/transforms/__init__.py index 53a303d..8b6eb52 100644 --- a/fvcore/transforms/__init__.py +++ b/fvcore/transforms/__init__.py @@ -1,3 +1,5 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + from .transform import * diff --git a/io_tests/test_file_io.py b/io_tests/test_file_io.py index 26bb845..dceb8cc 100644 --- a/io_tests/test_file_io.py +++ b/io_tests/test_file_io.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import os import shutil import tempfile diff --git a/tests/__init__.py b/tests/__init__.py index 5c7f19c..5276b67 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1 +1,3 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +# pyre-strict diff --git a/tests/bm_common.py b/tests/bm_common.py index faf559c..80df6ca 100644 --- a/tests/bm_common.py +++ b/tests/bm_common.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + from fvcore.common.benchmark import benchmark from test_common import TestHistoryBuffer diff --git a/tests/bm_focal_loss.py b/tests/bm_focal_loss.py index 6544fc9..d0af9f5 100644 --- a/tests/bm_focal_loss.py +++ b/tests/bm_focal_loss.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import torch from fvcore.common.benchmark import benchmark from test_focal_loss import TestFocalLoss, TestFocalLossStar diff --git a/tests/bm_main.py b/tests/bm_main.py index c63885f..964fff2 100755 --- a/tests/bm_main.py +++ b/tests/bm_main.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import glob import importlib import sys diff --git a/tests/param_scheduler/test_scheduler_composite.py b/tests/param_scheduler/test_scheduler_composite.py index 730f61a..c65c69b 100644 --- a/tests/param_scheduler/test_scheduler_composite.py +++ b/tests/param_scheduler/test_scheduler_composite.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. +# pyre-ignore-all-errors + import copy import unittest diff --git a/tests/param_scheduler/test_scheduler_constant.py b/tests/param_scheduler/test_scheduler_constant.py index 5a63bb1..f6b2a93 100644 --- a/tests/param_scheduler/test_scheduler_constant.py +++ b/tests/param_scheduler/test_scheduler_constant.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. +# pyre-ignore-all-errors + import unittest from fvcore.common.param_scheduler import ConstantParamScheduler diff --git a/tests/param_scheduler/test_scheduler_cosine.py b/tests/param_scheduler/test_scheduler_cosine.py index b7306f1..0da68b5 100644 --- a/tests/param_scheduler/test_scheduler_cosine.py +++ b/tests/param_scheduler/test_scheduler_cosine.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. +# pyre-ignore-all-errors + import copy import unittest diff --git a/tests/param_scheduler/test_scheduler_exponential.py b/tests/param_scheduler/test_scheduler_exponential.py index 4c94b97..7adff52 100644 --- a/tests/param_scheduler/test_scheduler_exponential.py +++ b/tests/param_scheduler/test_scheduler_exponential.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. +# pyre-ignore-all-errors + import unittest from fvcore.common.param_scheduler import ExponentialParamScheduler diff --git a/tests/param_scheduler/test_scheduler_linear.py b/tests/param_scheduler/test_scheduler_linear.py index 2eb8e41..764f352 100644 --- a/tests/param_scheduler/test_scheduler_linear.py +++ b/tests/param_scheduler/test_scheduler_linear.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. +# pyre-ignore-all-errors + import unittest from fvcore.common.param_scheduler import LinearParamScheduler diff --git a/tests/param_scheduler/test_scheduler_multi_step.py b/tests/param_scheduler/test_scheduler_multi_step.py index c3462da..d1e24f6 100644 --- a/tests/param_scheduler/test_scheduler_multi_step.py +++ b/tests/param_scheduler/test_scheduler_multi_step.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. +# pyre-ignore-all-errors + import copy import unittest diff --git a/tests/param_scheduler/test_scheduler_polynomial.py b/tests/param_scheduler/test_scheduler_polynomial.py index db18af0..22e54ea 100644 --- a/tests/param_scheduler/test_scheduler_polynomial.py +++ b/tests/param_scheduler/test_scheduler_polynomial.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. +# pyre-ignore-all-errors + import unittest from fvcore.common.param_scheduler import PolynomialDecayParamScheduler diff --git a/tests/param_scheduler/test_scheduler_step.py b/tests/param_scheduler/test_scheduler_step.py index 979c9f2..b85477b 100644 --- a/tests/param_scheduler/test_scheduler_step.py +++ b/tests/param_scheduler/test_scheduler_step.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. +# pyre-ignore-all-errors + import copy import unittest from typing import Any, Dict diff --git a/tests/param_scheduler/test_scheduler_step_with_fixed_gamma.py b/tests/param_scheduler/test_scheduler_step_with_fixed_gamma.py index d22c56c..1ddde94 100644 --- a/tests/param_scheduler/test_scheduler_step_with_fixed_gamma.py +++ b/tests/param_scheduler/test_scheduler_step_with_fixed_gamma.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. +# pyre-ignore-all-errors + import copy import unittest diff --git a/tests/test_activation_count.py b/tests/test_activation_count.py index b716f07..c87a4e2 100644 --- a/tests/test_activation_count.py +++ b/tests/test_activation_count.py @@ -1,4 +1,6 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +# pyre-strict # pyre-ignore-all-errors[2] import typing diff --git a/tests/test_checkpoint.py b/tests/test_checkpoint.py index 85f2412..537ce71 100644 --- a/tests/test_checkpoint.py +++ b/tests/test_checkpoint.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import copy import os import random diff --git a/tests/test_common.py b/tests/test_common.py index 7554e80..6d27070 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import math import time import typing diff --git a/tests/test_flop_count.py b/tests/test_flop_count.py index 8ab7eeb..a871379 100644 --- a/tests/test_flop_count.py +++ b/tests/test_flop_count.py @@ -1,4 +1,6 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +# pyre-strict # pyre-ignore-all-errors[2,3,14,53] import typing import unittest diff --git a/tests/test_focal_loss.py b/tests/test_focal_loss.py index 435ef54..1e2e6bf 100644 --- a/tests/test_focal_loss.py +++ b/tests/test_focal_loss.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import typing import unittest diff --git a/tests/test_giou_loss.py b/tests/test_giou_loss.py index 24ca0dc..b8606b6 100644 --- a/tests/test_giou_loss.py +++ b/tests/test_giou_loss.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import unittest import numpy as np diff --git a/tests/test_jit_model_analysis.py b/tests/test_jit_model_analysis.py index 529c6b9..e300dc9 100644 --- a/tests/test_jit_model_analysis.py +++ b/tests/test_jit_model_analysis.py @@ -1,4 +1,6 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved + +# pyre-strict # pyre-ignore-all-errors[2,56] import logging diff --git a/tests/test_layers_squeeze_excitation.py b/tests/test_layers_squeeze_excitation.py index db090c9..da9204a 100644 --- a/tests/test_layers_squeeze_excitation.py +++ b/tests/test_layers_squeeze_excitation.py @@ -1,4 +1,6 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + +# pyre-strict import itertools import unittest from typing import Iterable diff --git a/tests/test_param_count.py b/tests/test_param_count.py index 7f4464d..64482bd 100644 --- a/tests/test_param_count.py +++ b/tests/test_param_count.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import unittest diff --git a/tests/test_precise_bn.py b/tests/test_precise_bn.py index e150b4c..2558112 100644 --- a/tests/test_precise_bn.py +++ b/tests/test_precise_bn.py @@ -1,6 +1,8 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # -*- coding: utf-8 -*- +# pyre-strict + import itertools import unittest from typing import List, Tuple diff --git a/tests/test_print_model_statistics.py b/tests/test_print_model_statistics.py index 9a5ea59..67d33e1 100644 --- a/tests/test_print_model_statistics.py +++ b/tests/test_print_model_statistics.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# pyre-strict + import unittest from typing import Dict diff --git a/tests/test_smooth_l1_loss.py b/tests/test_smooth_l1_loss.py index f6e1bfc..4d361bb 100644 --- a/tests/test_smooth_l1_loss.py +++ b/tests/test_smooth_l1_loss.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import unittest import numpy as np diff --git a/tests/test_transform_util.py b/tests/test_transform_util.py index 5189681..bf10967 100644 --- a/tests/test_transform_util.py +++ b/tests/test_transform_util.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import unittest import numpy as np diff --git a/tests/test_weight_init.py b/tests/test_weight_init.py index ba1164b..4d26ffd 100644 --- a/tests/test_weight_init.py +++ b/tests/test_weight_init.py @@ -1,5 +1,7 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# pyre-strict + import itertools import math import unittest