We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8abbd5 commit 4666678Copy full SHA for 4666678
pytorch_optimizer/optimizer/utils.py
@@ -7,7 +7,7 @@
7
import torch
8
from torch import nn
9
from torch.distributed import all_reduce
10
-from torch.nn import functional as f
+from torch.nn.functional import cosine_similarity
11
from torch.nn.modules.batchnorm import _BatchNorm
12
from torch.nn.utils import clip_grad_norm_
13
@@ -119,7 +119,7 @@ def cosine_similarity_by_view(
119
"""
120
x = view_func(x)
121
y = view_func(y)
122
- return f.cosine_similarity(x, y, dim=1, eps=eps).abs_()
+ return cosine_similarity(x, y, dim=1, eps=eps).abs_()
123
124
125
def clip_grad_norm(
0 commit comments