@@ -435,14 +435,14 @@ void BatchNormDoubleGradKernel(const Context& dev_ctx,
435435 DenseTensor transformed_ddy (ddY->type ());
436436 if (data_layout == DataLayout::NCHW && x_dims.size () > 2 ) {
437437 VLOG (3 ) << " Transform batchnorm output from NCHW to NHWC" ;
438- // Input Tensor
438+ // Input DenseTensor
439439 ResizeToChannelLast<Context, T>(dev_ctx, X, &transformed_x);
440440 TransToChannelLast<Context, T>(dev_ctx, X, &transformed_x);
441441 ResizeToChannelLast<Context, T>(dev_ctx, dY, &transformed_dy);
442442 TransToChannelLast<Context, T>(dev_ctx, dY, &transformed_dy);
443443 ResizeToChannelLast<Context, T>(dev_ctx, ddX, &transformed_ddx);
444444 TransToChannelLast<Context, T>(dev_ctx, ddX, &transformed_ddx);
445- // Output Tensor
445+ // Output DenseTensor
446446 ResizeToChannelLast<Context, T>(dev_ctx, dX, &transformed_dx);
447447 ResizeToChannelLast<Context, T>(dev_ctx, ddY, &transformed_ddy);
448448 } else {
@@ -458,7 +458,7 @@ void BatchNormDoubleGradKernel(const Context& dev_ctx,
458458 ConstEigenVectorArrayMap<T> mean_arr (mean_data, C);
459459 ConstEigenVectorArrayMap<T> inv_var_arr (inv_var_data, C);
460460
461- Tensor mean_tile;
461+ DenseTensor mean_tile;
462462 mean_tile.Resize ({C, sample_size});
463463 EigenArrayMap<T> mean_tile_data (
464464 dev_ctx.template Alloc <T>(&mean_tile), C, sample_size);
@@ -480,7 +480,7 @@ void BatchNormDoubleGradKernel(const Context& dev_ctx,
480480 ConstEigenVectorArrayMap<T> scale_arr (
481481 Scale ? Scale->data <T>() : Scale_data.data <T>(), C);
482482
483- Tensor scale_tile;
483+ DenseTensor scale_tile;
484484 scale_tile.Resize ({C, sample_size});
485485 EigenArrayMap<T> scale_tile_data (
486486 dev_ctx.template Alloc <T>(&scale_tile), C, sample_size);
@@ -505,7 +505,7 @@ void BatchNormDoubleGradKernel(const Context& dev_ctx,
505505 // math: dx = (ddscale * dy) * inv_var
506506 if (ddScale) {
507507 ConstEigenVectorArrayMap<T> ddscale_arr (ddScale->data <T>(), C);
508- Tensor ddscale_tile;
508+ DenseTensor ddscale_tile;
509509 ddscale_tile.Resize ({C, sample_size});
510510 EigenArrayMap<T> ddscale_tile_data (
511511 dev_ctx.template Alloc <T>(&ddscale_tile), C, sample_size);
@@ -557,7 +557,7 @@ void BatchNormDoubleGradKernel(const Context& dev_ctx,
557557 }
558558 if (ddScale) {
559559 ConstEigenVectorArrayMap<T> ddscale_arr (ddScale->data <T>(), C);
560- Tensor ddscale_tile;
560+ DenseTensor ddscale_tile;
561561 ddscale_tile.Resize ({C, sample_size});
562562 EigenArrayMap<T> ddscale_tile_data (
563563 dev_ctx.template Alloc <T>(&ddscale_tile), C, sample_size);
@@ -594,7 +594,7 @@ void BatchNormDoubleGradKernel(const Context& dev_ctx,
594594 // inv_var.pow(2) * np.mean(dy * (x-mean), axis=(n,h,w)))) *
595595 // ddx
596596 if (ddX) {
597- Tensor first_grad;
597+ DenseTensor first_grad;
598598 first_grad.Resize ({C, sample_size});
599599 EigenArrayMap<T> first_grad_arr (
600600 dev_ctx.template Alloc <T>(&first_grad), C, sample_size);
@@ -645,7 +645,7 @@ void BatchNormDoubleGradKernel(const Context& dev_ctx,
645645 }
646646 if (ddScale) {
647647 ConstEigenVectorArrayMap<T> ddscale_arr (ddScale->data <T>(), C);
648- Tensor ddscale_tile;
648+ DenseTensor ddscale_tile;
649649 ddscale_tile.Resize ({C, sample_size});
650650 EigenArrayMap<T> ddscale_tile_data (
651651 dev_ctx.template Alloc <T>(&ddscale_tile), C, sample_size);
@@ -656,7 +656,7 @@ void BatchNormDoubleGradKernel(const Context& dev_ctx,
656656
657657 if (ddBias) {
658658 ConstEigenVectorArrayMap<T> ddbias_arr (ddBias->data <T>(), C);
659- Tensor ddbias_tile;
659+ DenseTensor ddbias_tile;
660660 ddbias_tile.Resize ({C, sample_size});
661661 EigenArrayMap<T> ddbias_tile_data (
662662 dev_ctx.template Alloc <T>(&ddbias_tile), C, sample_size);
0 commit comments