Changeset 636bc43


Ignore:
Timestamp:
Dec 29, 2021, 5:52:02 PM (2 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/crepe
Children:
1666945
Parents:
c78f151
git-author:
Paul Brossier <piem@piem.org> (01/29/19 03:36:35)
git-committer:
Paul Brossier <piem@piem.org> (12/29/21 17:52:02)
Message:

[conv2d] copy params in set_kernel, set_bias

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ai/conv2d.c

    rc78f151 r636bc43  
    479479uint_t aubio_conv2d_set_kernel(aubio_conv2d_t *c, aubio_tensor_t *kernel)
    480480{
    481   uint_t i;
    482481  AUBIO_ASSERT(c && kernel);
    483   for (i = 0; i < c->kernel->ndim; i++) {
    484     AUBIO_ASSERT(c->kernel->shape[i] == kernel->shape[i]);
    485   }
    486   return AUBIO_OK;
     482  if (aubio_tensor_have_same_shape(kernel, c->kernel)) {
     483    aubio_tensor_copy(kernel, c->kernel);
     484    return AUBIO_OK;
     485  }
     486  return AUBIO_FAIL;
    487487}
    488488
     
    496496{
    497497  AUBIO_ASSERT(c && bias);
    498   AUBIO_ASSERT(c->kernel_shape[1] == bias->length);
     498  if (bias->length == c->bias->length) {
     499    fvec_copy(bias, c->bias);
     500    return AUBIO_OK;
     501  }
    499502  return AUBIO_OK;
    500503}
Note: See TracChangeset for help on using the changeset viewer.