extend agc to any dimension

This commit is contained in:
Less Wright
2021-07-02 17:05:25 -07:00
committed by GitHub
parent ac9bc7af39
commit aab030163c
+1 -3
View File
@@ -379,9 +379,7 @@ class Ranger21(TO.Optimizer):
elif xlen == 4: # conv kernels
dim = (1, 2, 3)
else:
raise ValueError(
f"unit_norm:: adaptive gclipping: unable to process len of {xlen} - currently must be <= 4"
)
dim = tuple([x for x in range(1,xlen)]) # create 1,..., xlen-1 tuple, while avoiding last dim ...
return x.norm(dim=dim, keepdim=keepdim, p=2.0)