Skip to content

Commit

Permalink
fix torch frontends: fixing a small bug in the frontend norm which wa…
Browse files Browse the repository at this point in the history
…s not handling the case wherein dim !=None and ord is None.
  • Loading branch information
YushaArif99 committed Sep 14, 2024
1 parent 3186f7b commit 4941cf0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ivy/functional/frontends/torch/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ def norm(input, ord=None, dim=None, keepdim=False, *, dtype=None, out=None):
elif dim is None and ord is None:
input = ivy.flatten(input)
ret = ivy.vector_norm(input, axis=0, keepdims=keepdim, ord=2)
elif dim != None and ord is None:
ret = ivy.vector_norm(input, axis=dim, keepdims=keepdim, ord=2)
elif isinstance(dim, int):
ret = ivy.vector_norm(input, axis=dim, keepdims=keepdim, ord=ord)
elif isinstance(dim, tuple) and len(dim) <= 2:
Expand Down

0 comments on commit 4941cf0

Please sign in to comment.