Changeset 7420c40
- Timestamp:
- Jan 8, 2019, 12:06:02 AM (6 years ago)
- Branches:
- feature/cnn_org, feature/crepe_org
- Children:
- 8691154
- Parents:
- f9f03ff
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ai/maxpool2d.c
rf9f03ff r7420c40 102 102 for (k = 0; k < output_tensor->shape[2]; k++) 103 103 { 104 smpl_t m = -10000.; 104 uint_t stride_i = i * c->pool_size[0]; 105 uint_t stride_j = j * c->pool_size[1]; 106 smpl_t m = input_tensor->data[stride_i][stride_j 107 * input_tensor->shape[2] + k]; 105 108 for (a = 0; a < c->pool_size[0]; a++) { 106 109 for (b = 0; b < c->pool_size[1]; b++) { 107 uint_t idx = ( j * c->pool_size[1]+ b) * input_tensor->shape[2] + k;108 m = MAX(m, input_tensor->data[ i * c->pool_size[0]+ a][idx]);110 uint_t idx = (stride_j + b) * input_tensor->shape[2] + k; 111 m = MAX(m, input_tensor->data[stride_i + a][idx]); 109 112 } 110 113 }
Note: See TracChangeset
for help on using the changeset viewer.