titans-pytorch 0.4.10__tar.gz → 0.4.11__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: titans-pytorch
3
- Version: 0.4.10
3
+ Version: 0.4.11
4
4
  Summary: Titans
5
5
  Project-URL: Homepage, https://pypi.org/project/titans-pytorch/
6
6
  Project-URL: Repository, https://github.com/lucidrains/titans-pytorch
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "titans-pytorch"
3
- version = "0.4.10"
3
+ version = "0.4.11"
4
4
  description = "Titans"
5
5
  authors = [
6
6
  { name = "Phil Wang", email = "lucidrains@gmail.com" }
@@ -161,8 +161,7 @@ def newtonschulz5(
161
161
  eps = 1e-7,
162
162
  coefs = (3.4445, -4.7750, 2.0315)
163
163
  ):
164
- if t.ndim <= 3:
165
- return t
164
+ t, inv_pack = pack_one_with_inverse(t, '* i j')
166
165
 
167
166
  shape = t.shape
168
167
  should_transpose = shape[-2] > shape[-1]
@@ -170,7 +169,6 @@ def newtonschulz5(
170
169
  if should_transpose:
171
170
  t = t.transpose(-1, -2)
172
171
 
173
- t, inv_pack = pack_one_with_inverse(t, '* i j')
174
172
  t = t / t.norm(dim = (-1, -2), keepdim = True).clamp(min = eps)
175
173
 
176
174
  a, b, c = coefs
File without changes