Changeset b6097ac


Ignore:
Timestamp:
Dec 29, 2021, 5:51:48 PM (3 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe
Children:
337e70d
Parents:
bee3d52
git-author:
Paul Brossier <piem@piem.org> (01/08/19 15:12:35)
git-committer:
Paul Brossier <piem@piem.org> (12/29/21 17:51:48)
Message:

[conv2d] set_stride accepts int[]

Location:
src/ai
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ai/conv2d.c

    rbee3d52 rb6097ac  
    6666  c->padding_mode = PAD_VALID;
    6767  // set default stride_shape to {1, 1}
    68   aubio_conv2d_set_stride(c, 1, 1);
     68  {
     69    uint_t default_stride[2] = {1, 1};
     70    aubio_conv2d_set_stride(c, default_stride);
     71  }
    6972
    7073  return c;
     
    8992
    9093uint_t aubio_conv2d_set_stride(aubio_conv2d_t *c,
    91     uint_t stride1, uint_t stride2)
    92 {
    93   if ((sint_t)stride1 < 1) return AUBIO_FAIL;
    94   if ((sint_t)stride2 < 1) return AUBIO_FAIL;
    95   c->stride_shape[0] = stride1;
    96   c->stride_shape[1] = stride2;
     94    uint_t stride[2])
     95{
     96  if ((sint_t)stride[0] < 1) return AUBIO_FAIL;
     97  if ((sint_t)stride[1] < 1) return AUBIO_FAIL;
     98  c->stride_shape[0] = stride[0];
     99  c->stride_shape[1] = stride[1];
    97100  return AUBIO_OK;
    98101}
     
    191194    * c->kernel->shape[1] * c->kernel->shape[3];
    192195
    193   AUBIO_DBG("conv2d: input %s ¤ conv2d %s"
     196  AUBIO_DBG("conv2d:    %15s ¤ conv2d %s"
    194197      " : (%d, %d, %d)"
    195198      " (%d params, stride (%d, %d), pad_start [%d, %d])\n",
  • src/ai/conv2d.h

    rbee3d52 rb6097ac  
    5252/** set conv2d stride */
    5353uint_t aubio_conv2d_set_stride(aubio_conv2d_t *c,
    54     uint_t stride1, uint_t stride2);
     54    uint_t stride[2]);
    5555
    5656uint_t *aubio_conv2d_get_stride(aubio_conv2d_t* t);
Note: See TracChangeset for help on using the changeset viewer.