torch-einops-utils 0.0.25__py3-none-any.whl → 0.0.26__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- torch_einops_utils/device.py +12 -0
- {torch_einops_utils-0.0.25.dist-info → torch_einops_utils-0.0.26.dist-info}/METADATA +1 -1
- torch_einops_utils-0.0.26.dist-info/RECORD +8 -0
- torch_einops_utils-0.0.25.dist-info/RECORD +0 -8
- {torch_einops_utils-0.0.25.dist-info → torch_einops_utils-0.0.26.dist-info}/WHEEL +0 -0
- {torch_einops_utils-0.0.25.dist-info → torch_einops_utils-0.0.26.dist-info}/licenses/LICENSE +0 -0
torch_einops_utils/device.py
CHANGED
|
@@ -36,3 +36,15 @@ def move_inputs_to_device(device):
|
|
|
36
36
|
return inner
|
|
37
37
|
|
|
38
38
|
return decorator
|
|
39
|
+
|
|
40
|
+
def move_inputs_to_module_device(fn):
|
|
41
|
+
|
|
42
|
+
@wraps(fn)
|
|
43
|
+
def inner(self, *args, **kwargs):
|
|
44
|
+
device = module_device(self)
|
|
45
|
+
|
|
46
|
+
args, kwargs = tree_map_tensor(lambda t: t.to(device), (args, kwargs))
|
|
47
|
+
|
|
48
|
+
return fn(*args, **kwargs)
|
|
49
|
+
|
|
50
|
+
return inner
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: torch-einops-utils
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.26
|
|
4
4
|
Summary: Personal utility functions
|
|
5
5
|
Project-URL: Homepage, https://pypi.org/project/torch-einops-utils/
|
|
6
6
|
Project-URL: Repository, https://github.com/lucidrains/torch-einops-utils
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
torch_einops_utils/__init__.py,sha256=RBqs2yPtP51KVi73b-D75S7rIbQJpUOh1IoE3G9j-9E,1008
|
|
2
|
+
torch_einops_utils/device.py,sha256=4cxmpN3auqqsyj471-cTHHueRyMZp1IxxNFcOOrO6jQ,1058
|
|
3
|
+
torch_einops_utils/save_load.py,sha256=K-i7nmLyXBHdAfBLN3rGQzI3NVf6RRwF_GcrKQnfQsc,2669
|
|
4
|
+
torch_einops_utils/torch_einops_utils.py,sha256=GG1QMs-bH1y3twJ9eu7brmO4fE8tMrmXN_SdfkLD2ZI,6728
|
|
5
|
+
torch_einops_utils-0.0.26.dist-info/METADATA,sha256=ekLkLve6_uuxtAERk3n9VazkGH5-Vo423SP56WVwNGA,2139
|
|
6
|
+
torch_einops_utils-0.0.26.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
7
|
+
torch_einops_utils-0.0.26.dist-info/licenses/LICENSE,sha256=e6AOF7Z8EFdK3IdcL0x0fLw4cY7Q0d0kNR0o0TmBewM,1066
|
|
8
|
+
torch_einops_utils-0.0.26.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
torch_einops_utils/__init__.py,sha256=RBqs2yPtP51KVi73b-D75S7rIbQJpUOh1IoE3G9j-9E,1008
|
|
2
|
-
torch_einops_utils/device.py,sha256=r4hNXVluxMqk0awCtEMmzbBR5-uJ0KBxPIKGPzVsSwU,794
|
|
3
|
-
torch_einops_utils/save_load.py,sha256=K-i7nmLyXBHdAfBLN3rGQzI3NVf6RRwF_GcrKQnfQsc,2669
|
|
4
|
-
torch_einops_utils/torch_einops_utils.py,sha256=GG1QMs-bH1y3twJ9eu7brmO4fE8tMrmXN_SdfkLD2ZI,6728
|
|
5
|
-
torch_einops_utils-0.0.25.dist-info/METADATA,sha256=FqPrFqbyuWx18fr_TiAsVZj3p_b_NwN6YWaGXs4oIuo,2139
|
|
6
|
-
torch_einops_utils-0.0.25.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
7
|
-
torch_einops_utils-0.0.25.dist-info/licenses/LICENSE,sha256=e6AOF7Z8EFdK3IdcL0x0fLw4cY7Q0d0kNR0o0TmBewM,1066
|
|
8
|
-
torch_einops_utils-0.0.25.dist-info/RECORD,,
|
|
File without changes
|
{torch_einops_utils-0.0.25.dist-info → torch_einops_utils-0.0.26.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|