File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -590,21 +590,6 @@ void CumWithIndicesInferMeta(const MetaTensor& x,
590
590
phi::errors::InvalidArgument (
591
591
" dtype of indices must be DataType::INT32 or DataType::INT64" ));
592
592
593
- if (dtype == DataType::INT32) {
594
- int _axis = 0 ;
595
- if (axis < 0 ) {
596
- _axis = axis + x_dims.size ();
597
- } else {
598
- _axis = axis;
599
- }
600
- PADDLE_ENFORCE_LT (
601
- common::vectorize (x_dims)[_axis],
602
- INT32_MAX,
603
- phi::errors::OutOfRange (
604
- " cummax with axis %ld may be overflow, set dtype int64 to continue" ,
605
- axis));
606
- }
607
-
608
593
if (x_dims.size () > 0 ) {
609
594
PADDLE_ENFORCE_GE (
610
595
axis,
@@ -633,6 +618,21 @@ void CumWithIndicesInferMeta(const MetaTensor& x,
633
618
axis));
634
619
}
635
620
621
+ if (dtype == DataType::INT32) {
622
+ int _axis = 0 ;
623
+ if (axis < 0 ) {
624
+ _axis = axis + x_dims.size ();
625
+ } else {
626
+ _axis = axis;
627
+ }
628
+ PADDLE_ENFORCE_LT (
629
+ common::vectorize (x_dims)[_axis],
630
+ INT32_MAX,
631
+ phi::errors::OutOfRange (
632
+ " cummax with axis %ld may be overflow, set dtype int64 to continue" ,
633
+ axis));
634
+ }
635
+
636
636
out->set_dims (x_dims);
637
637
out->set_dtype (x.dtype ());
638
638
out->share_lod (x);
You can’t perform that action at this time.
0 commit comments