Skip to content

Commit 4666678

Browse files
committed
refactor: import
1 parent e8abbd5 commit 4666678

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pytorch_optimizer/optimizer/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import torch
88
from torch import nn
99
from torch.distributed import all_reduce
10-
from torch.nn import functional as f
10+
from torch.nn.functional import cosine_similarity
1111
from torch.nn.modules.batchnorm import _BatchNorm
1212
from torch.nn.utils import clip_grad_norm_
1313

@@ -119,7 +119,7 @@ def cosine_similarity_by_view(
119119
"""
120120
x = view_func(x)
121121
y = view_func(y)
122-
return f.cosine_similarity(x, y, dim=1, eps=eps).abs_()
122+
return cosine_similarity(x, y, dim=1, eps=eps).abs_()
123123

124124

125125
def clip_grad_norm(

0 commit comments

Comments
 (0)