Skip to content

Commit 1d9dfb0

Browse files
committed
fix: torch.unique to np.unique
1 parent f29a9df commit 1d9dfb0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch_optimizer/optimizer/shampoo_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def __init__(
270270
shapes: List[Optional[List[torch.Tensor]]] = self.partitioner.shapes_for_pre_conditioners()
271271
self.statistics = [self.matrix_eps * torch.eye(shape[0], device=var.device) for shape in shapes if shape]
272272
self.pre_conditioners = [torch.eye(shape[0], device=var.device) for shape in shapes if shape]
273-
self.is_same_shapes = None not in shapes and len(torch.unique(shapes)) == 1
273+
self.is_same_shapes = None not in shapes and len(np.unique(shapes)) == 1
274274

275275
if self.is_same_shapes:
276276
self.statistics = torch.stack(self.statistics, dim=0)

0 commit comments

Comments
 (0)