@@ -319,13 +319,6 @@ def can_cast(from_: Union[Dtype, array], to: Dtype, /) -> bool:
319319 }
320320 return can_cast_dict [from_ ][to ]
321321
322- def test_bitwise_or (x : array , y : array ):
323- if not paddle .is_tensor (x ):
324- x = paddle .to_tensor (x )
325- if not paddle .is_tensor (y ):
326- y = paddle .to_tensor (y )
327- return paddle .bitwise_or (x , y )
328-
329322# Basic renames
330323bitwise_invert = paddle .bitwise_not
331324newaxis = None
@@ -339,7 +332,7 @@ def test_bitwise_or(x: array, y: array):
339332atan2 = _two_arg (paddle .atan2 )
340333bitwise_and = _two_arg (paddle .bitwise_and )
341334bitwise_left_shift = _two_arg (paddle .bitwise_left_shift )
342- bitwise_or = _two_arg (test_bitwise_or )
335+ bitwise_or = _two_arg (paddle . bitwise_or )
343336bitwise_right_shift = _two_arg (paddle .bitwise_right_shift )
344337bitwise_xor = _two_arg (paddle .bitwise_xor )
345338copysign = _two_arg (paddle .copysign )
@@ -527,6 +520,9 @@ def prod(
527520 dtype = _NP_2_PADDLE_DTYPE [dtype .name ]
528521
529522 if axis == ():
523+ # We can't upcast uint8 according to the spec because there is no
524+ # paddle.uint64, so at least upcast to int64 which is what sum does
525+ # when axis=None.
530526 if dtype is None :
531527 if x .dtype in [paddle .int8 , paddle .int16 , paddle .int32 , paddle .uint8 ]:
532528 return x .to (paddle .int64 )
@@ -537,8 +533,10 @@ def prod(
537533 return _reduce_multiple_axes (
538534 paddle .prod , x , axis , keepdim = keepdims , dtype = dtype , ** kwargs
539535 )
540-
536+
537+
541538 if axis is None :
539+ # paddle.prod doesn't support multiple axes
542540 if dtype is None and x .dtype == paddle .int32 :
543541 dtype = 'int64'
544542 res = paddle .prod (x , dtype = dtype , ** kwargs )
0 commit comments