Skip to content

Commit c42d567

Browse files
authored
[BIG tensor] enhance robustness of size calculation (#74370)
* [BIG tensor] enhance robustness of size calculation * Update axis_utils.h * Update axis_utils.h
1 parent 55e0573 commit c42d567

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

paddle/phi/kernels/funcs/axis_utils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static inline int CanonicalAxis(const int axis, const int rank) {
2626
return axis;
2727
}
2828

29-
template <typename T = int>
29+
template <typename T = int64_t>
3030
static inline T SizeToAxis(const int axis, DDim dims) {
3131
T size = 1;
3232
for (int i = 0; i < axis; i++) {
@@ -35,7 +35,7 @@ static inline T SizeToAxis(const int axis, DDim dims) {
3535
return size;
3636
}
3737

38-
template <typename T = int>
38+
template <typename T = int64_t>
3939
static inline T SizeFromAxis(const int axis, DDim dims) {
4040
T size = 1;
4141
for (int i = axis; i < dims.size(); i++) {
@@ -44,7 +44,7 @@ static inline T SizeFromAxis(const int axis, DDim dims) {
4444
return size;
4545
}
4646

47-
template <typename T = int>
47+
template <typename T = int64_t>
4848
static inline T SizeOutAxis(const int axis, DDim dims) {
4949
T size = 1;
5050
for (int i = axis + 1; i < dims.size(); i++) {

0 commit comments

Comments
 (0)