Skip to content

Commit f048fc7

Browse files
committed
refine code format in spacetobatchnd
1 parent 826adc9 commit f048fc7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/caffe/layers/space_to_batch_nd_layer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,12 @@ void SpaceToBatchNDLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,
105105
for(int i=0; i<top_temp.size(); i++){
106106
vector<int> coord_old = indices(i, top_shape);
107107
vector<int> coord_permuted = coord_old;
108-
for(int i=0; i<coord_old.size(); i++){
109-
coord_permuted[i] = coord_old[permuted_order[i]];
108+
for(int j=0; j<coord_old.size(); j++){
109+
coord_permuted[j] = coord_old[permuted_order[j]];
110110
}
111111
int position_permuted = offset(coord_permuted, permuted_shape);
112-
copy_n(top_temp.begin()+i, 1, top_data+position_permuted);
112+
//copy_n(top_temp.begin()+i, 1, top_data+position_permuted);
113+
top_data[position_permuted] = top_temp[i];
113114
}
114115

115116
// 4. Reshape permuted_reshaped_padded to flatten block_shape into the batch dimension, producing an output tensor of shape:

0 commit comments

Comments
 (0)