Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
JiangZhaoh committed May 26, 2020
1 parent 0577671 commit 40a14d9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/operator/tensor/index_add-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ struct IndexAddBackwardAKernel {
const mshadow::Shape<MXNET_SPECIAL_MAX_NDIM>& 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];
Expand Down
2 changes: 1 addition & 1 deletion src/operator/tensor/index_add_backward.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion src/operator/tensor/index_add_backward.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions src/operator/tensor/index_add_forward.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ struct IndexAddForwardCPUKernel {
const mshadow::Shape<MXNET_SPECIAL_MAX_NDIM>& val_stride,
const mshadow::Shape<MXNET_SPECIAL_MAX_NDIM>& val_shape,
const mshadow::Shape<MXNET_SPECIAL_MAX_NDIM>& 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])
Expand Down
2 changes: 1 addition & 1 deletion src/operator/tensor/index_add_forward.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 40a14d9

Please sign in to comment.