Skip to content

Commit 4941cf0

Browse files
committed
fix torch frontends: fixing a small bug in the frontend norm which was not handling the case wherein dim !=None and ord is None.
1 parent 3186f7b commit 4941cf0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ivy/functional/frontends/torch/linalg.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ def norm(input, ord=None, dim=None, keepdim=False, *, dtype=None, out=None):
233233
elif dim is None and ord is None:
234234
input = ivy.flatten(input)
235235
ret = ivy.vector_norm(input, axis=0, keepdims=keepdim, ord=2)
236+
elif dim != None and ord is None:
237+
ret = ivy.vector_norm(input, axis=dim, keepdims=keepdim, ord=2)
236238
elif isinstance(dim, int):
237239
ret = ivy.vector_norm(input, axis=dim, keepdims=keepdim, ord=ord)
238240
elif isinstance(dim, tuple) and len(dim) <= 2:

0 commit comments

Comments
 (0)