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

feat: Reformatted the container_types function in the jax backend #26193

Merged
merged 2 commits into from
Jul 13, 2024
Merged
Changes from 1 commit
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
15 changes: 13 additions & 2 deletions ivy/functional/backends/jax/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from numbers import Number
from operator import mul
from functools import reduce as _reduce
from typing import Optional, Union, Sequence, Callable, Tuple
from typing import Optional, Union, Sequence, Callable, Tuple, List, Type
import multiprocessing as _multiprocessing
import importlib

Expand All @@ -22,14 +22,25 @@
from . import backend_version


def container_types():
def container_types() -> List[Type]:
"""
Gets list of container types supported.

Returns:
List[Type]: List containing the FlatMapping container type.

Examples:
>>> container_types()
[FlatMapping]
"""
flat_mapping_spec = importlib.util.find_spec(
"FlatMapping", "haiku._src.data_structures"
)
if not flat_mapping_spec:
from haiku._src.data_structures import FlatMapping
else:
FlatMapping = importlib.util.module_from_spec(flat_mapping_spec)

return [FlatMapping]


Expand Down
Loading