Skip to content
Merged
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
10 changes: 4 additions & 6 deletions onnxruntime/contrib_ops/cpu/crop_and_resize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,8 @@ void CropAndResizeForward(const TensorShape& output_shape,
for (auto c = 0; c < channels; c++) {
int64_t index_n_c = index_n + c * pooled_width * pooled_height;
int64_t index = index_n_c + ph * pooled_width + pw;
const T* offset_bottom_data =
bottom_data +
static_cast<int64_t>((SafeInt<int64_t>(roi_batch_ind) * channels + c) * height * width);
const int64_t bottom_data_offset = (SafeInt<int64_t>(roi_batch_ind) * channels + c) * height * width;
const T* offset_bottom_data = bottom_data + bottom_data_offset;
const float top_left(static_cast<float>(offset_bottom_data[top_left_index]));
const float top_right(static_cast<float>(offset_bottom_data[top_right_index]));
const float bottom_left(static_cast<float>(offset_bottom_data[bottom_left_index]));
Expand All @@ -169,9 +168,8 @@ void CropAndResizeForward(const TensorShape& output_shape,
for (auto c = 0; c < channels; c++) {
int64_t index_n_c = index_n + c * pooled_width * pooled_height;
int64_t index = index_n_c + ph * pooled_width + pw;
const T* offset_bottom_data =
bottom_data +
static_cast<int64_t>((SafeInt<int64_t>(roi_batch_ind) * channels + c) * height * width);
const int64_t bottom_data_offset = (SafeInt<int64_t>(roi_batch_ind) * channels + c) * height * width;
const T* offset_bottom_data = bottom_data + bottom_data_offset;
top_data[index] = static_cast<float>(offset_bottom_data[closest_index]);
}
}
Expand Down
Loading