Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove 'from __future__ import annotations' #22125

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions jax/_src/abstract_arrays.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

from functools import partial

import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/ad_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

from collections.abc import Callable, Sequence
import functools
from functools import partial
Expand Down
1 change: 0 additions & 1 deletion jax/_src/ad_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations

from collections.abc import Callable
import types
Expand Down
1 change: 0 additions & 1 deletion jax/_src/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
tree_util.py), which include nested tuples/lists/dicts, where the leaves are
arrays.
"""
from __future__ import annotations

import collections
from collections.abc import Callable, Generator, Hashable, Iterable, Sequence
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/api_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

from collections.abc import Callable, Iterable, Sequence
import inspect
import operator
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

from collections import defaultdict
from collections.abc import Callable, Sequence
import enum
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/basearray.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

# Note that type annotations for this file are defined in basearray.pyi

from __future__ import annotations

import abc
import numpy as np
from typing import Any, Union
Expand Down
1 change: 0 additions & 1 deletion jax/_src/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Module for JAX callbacks."""
from __future__ import annotations

from collections.abc import Callable, Sequence
import dataclasses
Expand Down
1 change: 0 additions & 1 deletion jax/_src/checkify.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations

from collections.abc import Callable, Sequence
import dataclasses
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/clusters/cloud_tpu_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

import logging
import os
import re
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/clusters/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

from collections.abc import Sequence
import logging
from jax._src.cloud_tpu_init import running_in_cloud_tpu_vm
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/clusters/ompi_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

import os
import re
from jax._src import clusters
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/clusters/slurm_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

import os
from jax._src import clusters

Expand Down
2 changes: 0 additions & 2 deletions jax/_src/compilation_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

import logging
import threading
import warnings
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

# Interface to the compiler

from __future__ import annotations

from collections.abc import Sequence
import logging
import os
Expand Down
1 change: 0 additions & 1 deletion jax/_src/compute_on.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations
import threading
from contextlib import contextmanager

Expand Down
2 changes: 0 additions & 2 deletions jax/_src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

from collections.abc import Callable, Hashable, Iterator, Sequence
import contextlib
import functools
Expand Down
1 change: 0 additions & 1 deletion jax/_src/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations

from collections import Counter, defaultdict, deque, namedtuple
from collections.abc import (Callable, Collection, Generator, Hashable,
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/custom_batching.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

from collections.abc import Callable
import functools
import operator
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/custom_derivatives.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

from collections.abc import Callable, Sequence
import dataclasses
from functools import update_wrapper, reduce, partial
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/custom_transpose.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

from collections.abc import Callable
import functools
from typing import Any
Expand Down
1 change: 0 additions & 1 deletion jax/_src/debugger/cli_debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations

import cmd
import pprint
Expand Down
1 change: 0 additions & 1 deletion jax/_src/debugger/colab_debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Module for Colab-specific debugger."""
from __future__ import annotations

import html
import inspect
Expand Down
1 change: 0 additions & 1 deletion jax/_src/debugger/colab_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Module for building interfaces in Colab."""
from __future__ import annotations

import abc
import dataclasses
Expand Down
1 change: 0 additions & 1 deletion jax/_src/debugger/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations

from collections.abc import Hashable
import dataclasses
Expand Down
1 change: 0 additions & 1 deletion jax/_src/debugger/web_debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations

import atexit
import functools
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/debugging.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
# limitations under the License.
"""Module for JAX debugging primitives and related functionality."""

from __future__ import annotations

import importlib.util
from collections.abc import Callable, Sequence
import functools
Expand Down
1 change: 0 additions & 1 deletion jax/_src/dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

# Primitive dispatch and jit dispatch.
from __future__ import annotations

import atexit
from collections.abc import Callable, Iterator, Sequence
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

import atexit
from collections.abc import Sequence
import logging
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/dlpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

from typing import Any

from jax._src.api import device_put
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# b) the set of supported types (e.g., bfloat16),
# so we need our own implementation that deviates from NumPy in places.

from __future__ import annotations

import abc
import builtins
import functools
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/earray.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

import math

from jax._src import api_util
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
https://jax.readthedocs.io/en/latest/jep/10657-sequencing-effects.html.
"""

from __future__ import annotations

from collections.abc import Iterable, Set
from typing import Any

Expand Down
2 changes: 0 additions & 2 deletions jax/_src/environment_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

import platform
import subprocess
import sys
Expand Down
1 change: 0 additions & 1 deletion jax/_src/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations

from jax._src import core
from jax._src.util import set_module
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/export/_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

"""

from __future__ import annotations

from collections.abc import Callable, Sequence
import copy
import dataclasses
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/export/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

# Serialization and deserialization of _export.Exported

from __future__ import annotations

from collections.abc import Callable, Sequence
from functools import partial
from typing import TypeVar
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/export/shape_poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
See documentation at https://jax.readthedocs.io/en/latest/export/shape_poly.html.
"""

from __future__ import annotations

import enum
from collections.abc import Callable, Sequence
import dataclasses
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/export/shape_poly_decision.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

"""

from __future__ import annotations

from collections.abc import Sequence
import itertools
import math
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/extend/ffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

import os
import ctypes
from collections.abc import Iterable, Mapping, Sequence
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/image/scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

from collections.abc import Callable, Sequence
from functools import partial
import enum
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/internal_test_util/export_back_compat_test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ def func(...): ...

"""

from __future__ import annotations

from collections.abc import Callable, Iterable, Sequence
import dataclasses
import datetime
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/internal_test_util/lax_test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
# only, and may be changed or removed at any time and without any deprecation
# cycle.

from __future__ import annotations

import collections
import itertools
from typing import Union, cast
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/internal_test_util/test_harnesses.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
to fail. A Limitation is specific to a harness.
"""

from __future__ import annotations

from collections.abc import Callable, Iterable, Sequence
import operator
import os
Expand Down
2 changes: 0 additions & 2 deletions jax/_src/interpreters/ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations

from collections.abc import Callable, Sequence
import contextlib
import functools
Expand Down
1 change: 0 additions & 1 deletion jax/_src/interpreters/batching.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations

import collections
from collections.abc import Callable, Iterable, Sequence
Expand Down
Loading
Loading