torch-einops-utils 0.0.25__py3-none-any.whl → 0.0.27__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.
@@ -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(self, *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.25
3
+ Version: 0.0.27
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=d6RAR2Omq_FRQEw-ia4fJb0uZ56LrxXYxmbuEgDlCB8,1064
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.27.dist-info/METADATA,sha256=-LUzorTpJB689Q0gNg2GmG8jiHCMpeXlXBJvQ3kxcxo,2139
6
+ torch_einops_utils-0.0.27.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
7
+ torch_einops_utils-0.0.27.dist-info/licenses/LICENSE,sha256=e6AOF7Z8EFdK3IdcL0x0fLw4cY7Q0d0kNR0o0TmBewM,1066
8
+ torch_einops_utils-0.0.27.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,,