@@ -56,7 +56,7 @@ static void LinearInterpolationGrad(const DenseTensor& output_grad,
5656 for (int i = 0 ; i < n; i++) { // loop for batches
5757 for (int j = 0 ; j < c; j++) { // loop for channels
5858 // linear interpolation grad
59- if (data_layout == DataLayout::kNCHW ) {
59+ if (data_layout == DataLayout::NCHW ) {
6060 const MT grad = static_cast <MT>(output_grad_t (i, j, l));
6161 input_grad_t (i, j, x_w) += static_cast <T>(grad * d_e);
6262 input_grad_t (i, j, x_e) += static_cast <T>(grad * d_w);
@@ -118,7 +118,7 @@ static void BilinearInterpolationGrad(const DenseTensor& output_grad,
118118 for (int i = 0 ; i < n; i++) { // loop for batches
119119 for (int j = 0 ; j < c; j++) { // loop for channels
120120 // bilinear interpolation grad
121- if (data_layout == DataLayout::kNCHW ) {
121+ if (data_layout == DataLayout::NCHW ) {
122122 const MT grad = static_cast <MT>(output_grad_t (i, j, k, l));
123123 input_grad_t (i, j, y_n, x_w) += static_cast <T>(grad * d_s * d_e);
124124 input_grad_t (i, j, y_s, x_w) += static_cast <T>(grad * d_n * d_e);
@@ -163,7 +163,7 @@ static void NearestNeighborInterpolateGrad(const DenseTensor& output_grad,
163163
164164 for (int i = 0 ; i < n; i++) { // loop for batches
165165 for (int j = 0 ; j < c; j++) { // loop for channels
166- if (data_layout == DataLayout::kNCHW ) {
166+ if (data_layout == DataLayout::NCHW ) {
167167 input_grad_t (i, j, in_k, in_l) += output_grad_t (i, j, k, l);
168168 } else {
169169 input_grad_t (i, in_k, in_l, j) += output_grad_t (i, k, l, j);
@@ -218,7 +218,7 @@ static void BicubicInterpolationGrad(const DenseTensor& output_grad,
218218 static_cast <int64_t >(0 ));
219219 int access_y = std::max (std::min (input_y - 1 + jj, in_h - 1 ),
220220 static_cast <int64_t >(0 ));
221- if (data_layout == DataLayout::kNCHW ) {
221+ if (data_layout == DataLayout::NCHW ) {
222222 MT grad = static_cast <MT>(output_grad_t (i, j, k, l));
223223 input_grad_t (i, j, access_y, access_x) +=
224224 static_cast <T>(grad * y_coeffs[jj] * x_coeffs[ii]);
@@ -298,7 +298,7 @@ static void TrilinearInterpolationGrad(const DenseTensor& output_grad,
298298 for (int b = 0 ; b < n; b++) { // loop for batches
299299 for (int i = 0 ; i < c; i++) { // loop for channels
300300 // trilinear interpolation grad
301- if (data_layout == DataLayout::kNCHW ) {
301+ if (data_layout == DataLayout::NCHW ) {
302302 const MT grad = static_cast <MT>(output_grad_t (b, i, j, k, l));
303303 input_grad_t (b, i, t_f, y_n, x_w) +=
304304 static_cast <T>(grad * d_b * d_s * d_e);
@@ -377,7 +377,7 @@ static void NearestNeighbor3DInterpolateGrad(const DenseTensor& output_grad,
377377
378378 for (int i = 0 ; i < n; i++) { // loop for batches
379379 for (int j = 0 ; j < c; j++) { // loop for channels
380- if (data_layout == DataLayout::kNCHW ) {
380+ if (data_layout == DataLayout::NCHW ) {
381381 input_grad_t (i, j, in_d, in_k, in_l) +=
382382 output_grad_t (i, j, d, k, l);
383383 } else {
@@ -449,7 +449,7 @@ static void Interpolate1DCPUBwd(
449449 }
450450
451451 phi::DDim dim_grad;
452- if (data_layout == DataLayout::kNCHW ) {
452+ if (data_layout == DataLayout::NCHW ) {
453453 dim_grad = {n, c, in_w};
454454 } else {
455455 dim_grad = {n, in_w, c};
@@ -575,7 +575,7 @@ static void Interpolate2DCPUBwd(
575575 }
576576
577577 phi::DDim dim_grad;
578- if (data_layout == DataLayout::kNCHW ) {
578+ if (data_layout == DataLayout::NCHW ) {
579579 dim_grad = {n, c, in_h, in_w};
580580 } else {
581581 dim_grad = {n, in_h, in_w, c};
@@ -753,7 +753,7 @@ static void Interpolate3DCPUBwd(
753753 }
754754
755755 phi::DDim dim_grad;
756- if (data_layout == DataLayout::kNCHW ) {
756+ if (data_layout == DataLayout::NCHW ) {
757757 dim_grad = {n, c, in_d, in_h, in_w};
758758 } else {
759759 dim_grad = {n, in_d, in_h, in_w, c};
0 commit comments