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

fix #279, update description #281

Merged
merged 2 commits into from
Sep 18, 2023
Merged
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
8 changes: 4 additions & 4 deletions einops/_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
- backends are not imported unless those are actually needed, because
- backends may not be installed
- importing all available backends will drive to significant memory footprint
- backends may by present but installed with errors (but never used),
- backends may be present but installed with errors (but never used),
importing may drive to crashes
- backend should be either symbolic or imperative (tensorflow is for both, but that causes problems)
- backend should be either symbolic or imperative
- this determines which methods (from_numpy/to_numpy or create_symbol/eval_symbol) should be defined
- if backend can't (temporarily) provide symbols for shape dimensions, UnknownSize objects are used
- if backend can't provide symbols for shape dimensions, UnknownSize objects are used
"""

import sys
Expand All @@ -29,7 +29,7 @@ def get_backend(tensor) -> "AbstractBackend":
if _result is not None:
return _result

for framework_name, backend in _loaded_backends.items():
for framework_name, backend in list(_loaded_backends.items()):
if backend.is_appropriate_type(tensor):
_type2backend[_type] = backend
return backend
Expand Down
2 changes: 1 addition & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def main():
"chainer": ["chainer"],
"cupy": ["cupy"],
"paddle": ["paddlepaddle==0.0.0 -f https://www.paddlepaddle.org.cn/whl/linux/cpu-mkl/develop.html"],
"oneflow": ["oneflow==0.9.0+cpu -f https://release.oneflow.info"],
"oneflow": ["oneflow==0.9.0"],
}

usage = f"""
Expand Down