Changeset 45a1e1d for src


Ignore:
Timestamp:
Jan 8, 2019, 3:12:35 PM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn_org, feature/crepe_org
Children:
3ffea61d
Parents:
6ee6107
Message:

[conv2d] set_stride accepts int[]

Location:
src/ai
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/ai/conv2d.c

    r6ee6107 r45a1e1d  
    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

    r6ee6107 r45a1e1d  
    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.