Changeset 6627c87
- Timestamp:
- Dec 29, 2021, 5:52:01 PM (3 years ago)
- Branches:
- feature/crepe
- Children:
- 11e6f7a
- Parents:
- 8429515
- git-author:
- Paul Brossier <piem@piem.org> (01/29/19 03:00:01)
- git-committer:
- Paul Brossier <piem@piem.org> (12/29/21 17:52:01)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ai/conv1d.c
r8429515 r6627c87 36 36 uint_t n_filters; 37 37 uint_t kernel_shape; // kernel sizes 38 uint_t stride_shape ;// stride sizes38 uint_t stride_shape[1]; // stride sizes 39 39 40 40 aubio_conv1d_padding_type padding_mode; … … 98 98 { 99 99 if ((sint_t)stride[0] < 1) return AUBIO_FAIL; 100 c->stride_shape = stride[0];100 c->stride_shape[0] = stride[0]; 101 101 return AUBIO_OK; 102 102 } 103 103 104 uint_t aubio_conv1d_get_stride(aubio_conv1d_t *c)104 uint_t *aubio_conv1d_get_stride(aubio_conv1d_t *c) 105 105 { 106 106 return c->stride_shape; … … 127 127 // compute output shape 128 128 output_shape[0] = (uint_t)CEIL(input_tensor->shape[0] 129 / (smpl_t)c->stride_shape );130 131 padding_shape = (output_shape[0] - 1) * c->stride_shape +129 / (smpl_t)c->stride_shape[0]); 130 131 padding_shape = (output_shape[0] - 1) * c->stride_shape[0] + 132 132 c->kernel_shape - input_tensor->shape[0]; 133 133 … … 136 136 case PAD_VALID: 137 137 output_shape[0] = (input_tensor->shape[0] - c->kernel_shape + 1) 138 / c->stride_shape ;138 / c->stride_shape[0]; 139 139 140 140 padding_start = 0; … … 193 193 n_params, 194 194 c->kernel->shape[0], c->kernel->shape[1], c->kernel->shape[2], 195 c->stride_shape ,195 c->stride_shape[0], 196 196 -c->padding_start); 197 197 } … … 262 262 } 263 263 } 264 stride_a += c->stride_shape ;264 stride_a += c->stride_shape[0]; 265 265 // apply bias 266 266 activations->data[j][i] = acc + bias; … … 285 285 286 286 uint_t sdot_size = c->kernel->shape[0] * c->kernel->shape[1]; 287 uint_t input_stride = c->stride_shape * c->padded_input->shape[1];287 uint_t input_stride = c->stride_shape[0] * c->padded_input->shape[1]; 288 288 289 289 AUBIO_ASSERT(c && input_tensor && activations);
Note: See TracChangeset
for help on using the changeset viewer.