From 40a14d9d027086afd3f216f6b1ca26635b1475e3 Mon Sep 17 00:00:00 2001 From: JiangZhaoh Date: Tue, 26 May 2020 06:46:08 +0000 Subject: [PATCH] fix compile error --- src/operator/tensor/index_add-inl.h | 2 +- src/operator/tensor/index_add_backward.cc | 2 +- src/operator/tensor/index_add_backward.cu | 2 +- src/operator/tensor/index_add_forward.cc | 4 ++-- src/operator/tensor/index_add_forward.cu | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/operator/tensor/index_add-inl.h b/src/operator/tensor/index_add-inl.h index f657c0690eb2..e8eeebe6bba4 100644 --- a/src/operator/tensor/index_add-inl.h +++ b/src/operator/tensor/index_add-inl.h @@ -170,7 +170,7 @@ struct IndexAddBackwardAKernel { const mshadow::Shape& stride, const int tail_size, const int ind_num, const int ind_ndim, const int32_t* ind_vec, const int req, const int out_ndim) { - size_t id = 0; + index_t id = 0; int seg = MXNET_SPECIAL_MAX_NDIM - out_ndim; for (int dim = 0; dim < ind_ndim; ++dim) { id += stride[seg + dim] * ind_vec[dim * ind_num + i]; diff --git a/src/operator/tensor/index_add_backward.cc b/src/operator/tensor/index_add_backward.cc index e508e7325393..7f598df14bfd 100644 --- a/src/operator/tensor/index_add_backward.cc +++ b/src/operator/tensor/index_add_backward.cc @@ -51,7 +51,7 @@ struct IndexAddBackwardValCPUKernel { const int ograd_tail_size, const int ind_num, const int ind_ndim, const int32_t* ind_vec, const int out_ndim) { - size_t id = 0; + index_t id = 0; int seg = MXNET_SPECIAL_MAX_NDIM - out_ndim; for (int dim = 0; dim < ind_ndim; ++dim) { id += ograd_pre_stride[seg + dim] * ind_vec[dim * ind_num + i]; diff --git a/src/operator/tensor/index_add_backward.cu b/src/operator/tensor/index_add_backward.cu index 72dfe304c734..e471423b3529 100644 --- a/src/operator/tensor/index_add_backward.cu +++ b/src/operator/tensor/index_add_backward.cu @@ -55,7 +55,7 @@ struct IndexAddBackwardValGPUKernel { const int ograd_tail_size, const int ind_num, const int ind_ndim, const int32_t* ind_vec, const int out_ndim) { - size_t id = 0; + index_t id = 0; int seg = MXNET_SPECIAL_MAX_NDIM - out_ndim; for (int dim = 0; dim < ind_ndim; ++dim) { id += ograd_pre_stride[seg + dim] * ind_vec[dim * ind_num + i]; diff --git a/src/operator/tensor/index_add_forward.cc b/src/operator/tensor/index_add_forward.cc index c3bee1aa3b57..13e88ddaaaa3 100644 --- a/src/operator/tensor/index_add_forward.cc +++ b/src/operator/tensor/index_add_forward.cc @@ -35,10 +35,10 @@ struct IndexAddForwardCPUKernel { const mshadow::Shape& val_stride, const mshadow::Shape& val_shape, const mshadow::Shape& a_shape, - const size_t a_tail_size, const int ind_num, + const int a_tail_size, const int ind_num, const int ind_ndim, const int* ind, const int a_ndim) { - size_t id = 0; + index_t id = 0; int seg = MXNET_SPECIAL_MAX_NDIM - a_ndim; for (int dim = 0; dim < ind_ndim; ++dim) { CHECK_LT(ind[dim * ind_num + i], a_shape[seg + dim]) diff --git a/src/operator/tensor/index_add_forward.cu b/src/operator/tensor/index_add_forward.cu index 169578cac070..fcac6f8a3978 100644 --- a/src/operator/tensor/index_add_forward.cu +++ b/src/operator/tensor/index_add_forward.cu @@ -41,7 +41,7 @@ struct IndexAddForwardGPUKernel { const int a_tail_size, const int ind_num, const int ind_ndim, const int* ind, const int a_ndim) { - size_t id = 0; + index_t id = 0; int seg = MXNET_SPECIAL_MAX_NDIM - a_ndim; for (int dim = 0; dim < ind_ndim; ++dim) { id += a_pre_stride[seg + dim] * ind[dim * ind_num + i];