Changeset 1b9fe24


Ignore:
Timestamp:
Dec 29, 2021, 5:52:01 PM (3 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/crepe
Children:
ada7989
Parents:
0dad503
git-author:
Paul Brossier <piem@piem.org> (01/29/19 01:15:03)
git-committer:
Paul Brossier <piem@piem.org> (12/29/21 17:52:01)
Message:

[conv1d] add set_{kernel,bias}

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ai/conv1d.c

    r0dad503 r1b9fe24  
    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.