提交 3f8fa54b 编写于 作者: L liuqi

Add todo at mapping guard and format some code.

上级 affce29b
void kernel space_to_batch(global float* space_data_ptr,
global const int* block_shape_ptr,
global const int* paddings_ptr,
void kernel space_to_batch(global float *space_data_ptr,
global const int *block_shape_ptr,
global const int *paddings_ptr,
private const int space_batch,
private const int space_channel,
private const int space_height,
......@@ -28,10 +28,12 @@ void kernel space_to_batch(global float* space_data_ptr,
batch_pixel_height_idx * block_height;
int space_pixel_width_idx = (remaining_batch_idx % block_width) +
batch_pixel_width_idx * block_width;
const int batch_data_offset = batch_idx * (space_channel * batch_height * batch_width) +
(batch_channel_idx * batch_height * batch_width) +
batch_pixel_height_idx * batch_width +
batch_pixel_width_idx;
space_pixel_height_idx -= padding_height_start;
space_pixel_width_idx -= padding_width_start;
const int space_data_offset = space_idx * (space_channel * space_height * space_width) +
......
......@@ -22,6 +22,7 @@ static void BatchToSpaceHelper(const Tensor *input_tensor,
const index_t block_dims = block_shape_tensor->dim(0);
MACE_CHECK(block_dims == cropped_tensor->dim(0) && 2 == cropped_tensor->dim(1));
// TODO change tensor to attribute if needed based on the benchmark
Tensor::MappingGuard block_shape_tensor_mapper(block_shape_tensor);
Tensor::MappingGuard cropped_tensor_mapper(cropped_tensor);
const int *block_shape_ptr = block_shape_tensor->data<int>();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册