Skip to content
Snippets Groups Projects
Commit 77f9009d authored by Kaushik Kulkarni's avatar Kaushik Kulkarni
Browse files

implement norm by hand to be generic

parent a7b372aa
No related branches found
No related tags found
No related merge requests found
......@@ -183,12 +183,8 @@ class BaseFakeNumpyLinalgNamespace:
ord = 2
if is_array_container(ary):
import numpy.linalg as la
return la.norm(
[self.norm(subary, ord=ord)
for _, subary in serialize_container(ary)],
ord=ord)
return sum([self.norm(subary, ord=ord)**ord
for _, subary in serialize_container(ary)]) ** (1/ord)
if ary.size == 0:
return 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment