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

[MKLDNN] use dim_t instead of int in slice/transpose operators #16737

Merged
merged 4 commits into from
Nov 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/operator/nn/mkldnn/mkldnn_pooling.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ mkldnn::algorithm GetMKLDNNPoolAlgo(const PoolingParam &param) {
}
}

static inline int GetPaddingSizeFull(int x, int padl, int padr, int k, int s) {
static inline int GetPaddingSizeFull(dim_t x, int padl, int padr, int k, int s) {
if ((x + padl + padr - k) % s != 0) {
return (padr + s - ((x + padl + padr - k) % s));
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/operator/nn/mkldnn/mkldnn_slice.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ MKLDNNSliceFwd::MKLDNNSliceFwd(const SliceParam &param,
mkldnn::memory::dims dims(N);
mkldnn::memory::dims offsets(N);
for (int i = 0; i < N; ++i) {
int s = 0;
dim_t s = 0;
if (i < param.begin.ndim() && param.begin[i]) {
s = *param.begin[i];
if (s < 0) s += ishape[i];
Expand Down
2 changes: 1 addition & 1 deletion src/operator/nn/mkldnn/mkldnn_transpose.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class MKLDNNTransposeForward {

mkldnn_dims_t strides;
mkldnn_dims_t sh;
unsigned int total_stride = 1;
dim_t total_stride = 1;
for (int i = data_ndim - 1; i >= 0; i--) {
sh[i] = shape[i];
strides[axes[i]] = total_stride;
Expand Down