@@ -382,21 +382,23 @@ def norm(input, ord=None, axis=None, keepdims=False):
382382 Norm of the matrix or vector(s).
383383 """
384384
385- is_input_dparray = isinstance (input , dparray )
386-
387- if not use_origin_backend (input ) and is_input_dparray :
388- if keepdims is not False :
389- checker_throw_value_error ("norm" , "keepdims" , keepdims , False )
390- if not isinstance (axis , int ) and not isinstance (axis , tuple ) and axis is not None :
391- raise TypeError ("'axis' must be None, an integer or a tuple of integers" )
392-
393- result = dpnp_norm (input , ord = ord , axis = axis )
385+ if not use_origin_backend (input ):
386+ if not isinstance (input , dparray ):
387+ pass
388+ elif not isinstance (axis , int ) and not isinstance (axis , tuple ) and axis is not None :
389+ pass
390+ elif keepdims is not False :
391+ pass
392+ elif ord not in [None , 0 , 3 , 'fro' , 'f' ]:
393+ pass
394+ else :
395+ result = dpnp_norm (input , ord = ord , axis = axis )
394396
395- # scalar returned
396- if result .shape == (1 ,) and axis is None :
397- return result .dtype .type (result [0 ])
397+ # scalar returned
398+ if result .shape == (1 ,) and axis is None :
399+ return result .dtype .type (result [0 ])
398400
399- return result
401+ return result
400402
401403 return call_origin (numpy .linalg .norm , input , ord , axis , keepdims )
402404
0 commit comments