Changeset 3ff9654


Ignore:
Timestamp:
Jan 29, 2019, 1:15:03 AM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/crepe_org
Children:
e2010b3
Parents:
cc74a29
Message:

[conv1d] add set_{kernel,bias}

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ai/conv1d.c

    rcc74a29 r3ff9654  
    340340}
    341341
     342uint_t aubio_conv1d_set_kernel(aubio_conv1d_t *c, aubio_tensor_t *kernel)
     343{
     344  AUBIO_ASSERT(c && kernel);
     345  if (aubio_tensor_have_same_shape(c->kernel, kernel)) {
     346    aubio_tensor_copy(kernel, c->kernel);
     347    return AUBIO_OK;
     348  }
     349  return AUBIO_FAIL;
     350}
     351
     352uint_t aubio_conv1d_set_bias(aubio_conv1d_t *c, fvec_t *bias)
     353{
     354  AUBIO_ASSERT(c && bias);
     355  if (bias->length == c->bias->length) {
     356    fvec_copy(bias, c->bias);
     357    return AUBIO_OK;
     358  }
     359  return AUBIO_FAIL;
     360}
     361
    342362fvec_t *aubio_conv1d_get_bias(aubio_conv1d_t* c)
    343363{
Note: See TracChangeset for help on using the changeset viewer.