From 4941cf0e565d3de54853d19b329d8c3e94168851 Mon Sep 17 00:00:00 2001 From: Yusha Arif Date: Sat, 14 Sep 2024 19:55:40 +0000 Subject: [PATCH] fix torch frontends: fixing a small bug in the frontend norm which was not handling the case wherein dim !=None and ord is None. --- ivy/functional/frontends/torch/linalg.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ivy/functional/frontends/torch/linalg.py b/ivy/functional/frontends/torch/linalg.py index 34bbedd006e5..0174959d032b 100644 --- a/ivy/functional/frontends/torch/linalg.py +++ b/ivy/functional/frontends/torch/linalg.py @@ -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: