Skip to content

Commit 8cbe5d9

Browse files
committed
fix: remove duplicate cosine_similarity function from torch frontend
1 parent 68ba45b commit 8cbe5d9

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

ivy/functional/frontends/torch/nn/functional/loss_functions.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,6 @@ def calculate_loss(x1, x2, target):
178178
return loss
179179

180180

181-
def cosine_similarity(x1, x2):
182-
axis = None
183-
if len(x1.shape) == len(x2.shape) and len(x2.shape) == 2:
184-
axis = 1
185-
input1_norm = norm(x1, axis=axis)
186-
input2_norm = norm(x2, axis=axis)
187-
norm_mm = input1_norm * input2_norm
188-
norm_mm, eps = torch_frontend.promote_types_of_torch_inputs(norm_mm, 1e-08)
189-
return ivy.sum(x1 * x2, axis=axis) / ivy.maximum(norm_mm, eps)
190-
191-
192181
@to_ivy_arrays_and_back
193182
def cross_entropy(
194183
input,

0 commit comments

Comments
 (0)