metacontroller-pytorch 0.0.22__tar.gz → 0.0.23__tar.gz

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.

Potentially problematic release.


This version of metacontroller-pytorch might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metacontroller-pytorch
3
- Version: 0.0.22
3
+ Version: 0.0.23
4
4
  Summary: Transformer Metacontroller
5
5
  Project-URL: Homepage, https://pypi.org/project/metacontroller/
6
6
  Project-URL: Repository, https://github.com/lucidrains/metacontroller
@@ -40,6 +40,7 @@ Requires-Dist: einops>=0.8.1
40
40
  Requires-Dist: einx>=0.3.0
41
41
  Requires-Dist: loguru
42
42
  Requires-Dist: memmap-replay-buffer>=0.0.1
43
+ Requires-Dist: torch-einops-utils>=0.0.7
43
44
  Requires-Dist: torch>=2.5
44
45
  Requires-Dist: x-evolution>=0.1.23
45
46
  Requires-Dist: x-mlps-pytorch
@@ -26,6 +26,8 @@ from discrete_continuous_embed_readout import Embed, Readout, EmbedAndReadout
26
26
 
27
27
  from assoc_scan import AssocScan
28
28
 
29
+ from torch_einops_utils import pad_at_dim
30
+
29
31
  # constants
30
32
 
31
33
  LinearNoBias = partial(Linear, bias = False)
@@ -46,14 +48,6 @@ def default(*args):
46
48
  return arg
47
49
  return None
48
50
 
49
- def pad_at_dim(t, pad: tuple[int, int], dim = -1, value = 0.):
50
- if pad == (0, 0):
51
- return t
52
-
53
- dims_from_right = (- dim - 1) if dim < 0 else (t.ndim - dim - 1)
54
- zeros = ((0, 0) * dims_from_right)
55
- return F.pad(t, (*zeros, *pad), value = value)
56
-
57
51
  # tensor helpers
58
52
 
59
53
  def straight_through(src, tgt):
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "metacontroller-pytorch"
3
- version = "0.0.22"
3
+ version = "0.0.23"
4
4
  description = "Transformer Metacontroller"
5
5
  authors = [
6
6
  { name = "Phil Wang", email = "lucidrains@gmail.com" }
@@ -31,6 +31,7 @@ dependencies = [
31
31
  "loguru",
32
32
  "memmap-replay-buffer>=0.0.1",
33
33
  "torch>=2.5",
34
+ "torch-einops-utils>=0.0.7",
34
35
  "x-evolution>=0.1.23",
35
36
  "x-mlps-pytorch",
36
37
  "x-transformers"