@@ -354,19 +354,22 @@ def arctan2(x1, x2, dtype=None, out=None, where=True, **kwargs):
354354 [1.57079633, -1.57079633]
355355
356356 """
357- x1_is_scalar , x2_is_scalar = dpnp .isscalar (x1 ), dpnp .isscalar (x2 )
358- x1_is_dparray , x2_is_dparray = isinstance (x1 , dparray ), isinstance (x2 , dparray )
359357
360- if not use_origin_backend (x1 ) and not kwargs :
361- if not x1_is_dparray and not x1_is_scalar :
358+ x1_is_scalar = dpnp .isscalar (x1 )
359+ x2_is_scalar = dpnp .isscalar (x2 )
360+ x1_desc = dpnp .get_dpnp_descriptor (x1 )
361+ x2_desc = dpnp .get_dpnp_descriptor (x2 )
362+
363+ if x1_desc and x2_desc and not kwargs :
364+ if not x1_desc and not x1_is_scalar :
362365 pass
363- elif not x2_is_dparray and not x2_is_scalar :
366+ elif not x2_desc and not x2_is_scalar :
364367 pass
365368 elif x1_is_scalar and x2_is_scalar :
366369 pass
367- elif x1_is_dparray and x1 .ndim == 0 :
370+ elif x1_desc and x1_desc .ndim == 0 :
368371 pass
369- elif x2_is_dparray and x2 .ndim == 0 :
372+ elif x2_desc and x2_desc .ndim == 0 :
370373 pass
371374 elif out is not None and not isinstance (out , dparray ):
372375 pass
@@ -377,7 +380,7 @@ def arctan2(x1, x2, dtype=None, out=None, where=True, **kwargs):
377380 elif not where :
378381 pass
379382 else :
380- return dpnp_arctan2 (x1 , x2 , dtype = dtype , out = out , where = where )
383+ return dpnp_arctan2 (x1_desc , x2_desc , dtype = dtype , out = out , where = where )
381384
382385 return call_origin (numpy .arctan2 , x1 , x2 , dtype = dtype , out = out , where = where , ** kwargs )
383386
@@ -624,19 +627,22 @@ def hypot(x1, x2, dtype=None, out=None, where=True, **kwargs):
624627 [5.0, 5.0, 5.0]
625628
626629 """
627- x1_is_scalar , x2_is_scalar = dpnp .isscalar (x1 ), dpnp .isscalar (x2 )
628- x1_is_dparray , x2_is_dparray = isinstance (x1 , dparray ), isinstance (x2 , dparray )
629630
630- if not use_origin_backend (x1 ) and not kwargs :
631- if not x1_is_dparray and not x1_is_scalar :
631+ x1_is_scalar = dpnp .isscalar (x1 )
632+ x2_is_scalar = dpnp .isscalar (x2 )
633+ x1_desc = dpnp .get_dpnp_descriptor (x1 )
634+ x2_desc = dpnp .get_dpnp_descriptor (x2 )
635+
636+ if x1_desc and x2_desc and not kwargs :
637+ if not x1_desc and not x1_is_scalar :
632638 pass
633- elif not x2_is_dparray and not x2_is_scalar :
639+ elif not x2_desc and not x2_is_scalar :
634640 pass
635641 elif x1_is_scalar and x2_is_scalar :
636642 pass
637- elif x1_is_dparray and x1 .ndim == 0 :
643+ elif x1_desc and x1_desc .ndim == 0 :
638644 pass
639- elif x2_is_dparray and x2 .ndim == 0 :
645+ elif x2_desc and x2_desc .ndim == 0 :
640646 pass
641647 elif out is not None and not isinstance (out , dparray ):
642648 pass
@@ -647,7 +653,7 @@ def hypot(x1, x2, dtype=None, out=None, where=True, **kwargs):
647653 elif not where :
648654 pass
649655 else :
650- return dpnp_hypot (x1 , x2 , dtype = dtype , out = out , where = where )
656+ return dpnp_hypot (x1_desc , x2_desc , dtype = dtype , out = out , where = where )
651657
652658 return call_origin (numpy .hypot , x1 , x2 , dtype = dtype , out = out , where = where , ** kwargs )
653659
0 commit comments