ref: aca390df18785abf70823879d8a071ba8997fee8
parent: b50ddccf0e7c548803d079b21c5841bfd62939e9
author: Jan Buethe <jbuethe@amazon.de>
date: Fri Jul 28 13:19:48 EDT 2023
fixed wexchange for GRUs without bias
--- a/dnn/torch/weight-exchange/wexchange/c_export/common.py
+++ b/dnn/torch/weight-exchange/wexchange/c_export/common.py
@@ -303,6 +303,7 @@
N = weight.shape[0] // 3
for x in [weight, recurrent_weight, bias, recurrent_bias]:
+ if x is None: continue
tmp = x[0:N].copy()
x[0:N] = x[N:2*N]
x[N:2*N] = tmp
--- a/dnn/torch/weight-exchange/wexchange/torch/torch.py
+++ b/dnn/torch/weight-exchange/wexchange/torch/torch.py
@@ -41,8 +41,14 @@
w_ih = gru.weight_ih_l0.detach().cpu().numpy()
w_hh = gru.weight_hh_l0.detach().cpu().numpy()
- b_ih = gru.bias_ih_l0.detach().cpu().numpy()
- b_hh = gru.bias_hh_l0.detach().cpu().numpy()
+ if hasattr(gru, 'bias_ih_l0'):
+ b_ih = gru.bias_ih_l0.detach().cpu().numpy()
+ else:
+ b_ih = None
+ if hasattr(gru, 'bias_hh_l0'):
+ b_hh = gru.bias_hh_l0.detach().cpu().numpy()
+ else:
+ b_hh = None
if isinstance(where, CWriter):
return print_gru_layer(where, name, w_ih, w_hh, b_ih, b_hh, format='torch', input_sparse=input_sparse, recurrent_sparse=recurrent_sparse, quantize=quantize, scale=scale, recurrent_scale=recurrent_scale)
--- a/doc/draft-ietf-codec-opus-update.xml
+++ b/doc/draft-ietf-codec-opus-update.xml
@@ -109,7 +109,7 @@
+ sizeof(((silk_decoder *)decState)->sStereo));
+ /* Not strictly needed, but it's cleaner that way */
+ ((silk_decoder *)decState)->prev_decode_only_middle = 0;
-
+
return ret;
}
<CODE ENDS>
@@ -189,22 +189,22 @@
RESAMPLER_ORDER_FIR_12 ];
+ opus_int16 buf[ 2*RESAMPLER_MAX_BATCH_SIZE_IN + \
RESAMPLER_ORDER_FIR_12 ];
-
+
/* Copy buffered samples to start of buffer */
- silk_memcpy( buf, S->sFIR, RESAMPLER_ORDER_FIR_12 \
* sizeof( opus_int32 ) );
+ silk_memcpy( buf, S->sFIR, RESAMPLER_ORDER_FIR_12 \
* sizeof( opus_int16 ) );
-
+
/* Iterate over blocks of frameSizeIn input samples */
index_increment_Q16 = S->invRatio_Q16;
while( 1 ) {
nSamplesIn = silk_min( inLen, S->batchSize );
-
+
/* Upsample 2x */
silk_resampler_private_up2_HQ( S->sIIR, &buf[ \
RESAMPLER_ORDER_FIR_12 ], in, nSamplesIn );
-
+
max_index_Q16 = silk_LSHIFT32( nSamplesIn, 16 + 1 \
); /* + 1 because 2x upsampling */
out = silk_resampler_private_IIR_FIR_INTERPOL( out, \
@@ -211,7 +211,7 @@
buf, max_index_Q16, index_increment_Q16 );
in += nSamplesIn;
inLen -= nSamplesIn;
-
+
if( inLen > 0 ) {
/* More iterations to do; copy last part of \
filtered signal to beginning of buffer */
@@ -223,7 +223,7 @@
break;
}
}
-
+
/* Copy last part of filtered signal to the state for \
the next call */
- silk_memcpy( S->sFIR, &buf[ nSamplesIn << 1 ], \
@@ -284,7 +284,7 @@
NLSF_Q15[i-1] + NDeltaMin_Q15[i] );
+ NLSF_Q15[i] = silk_max_int( NLSF_Q15[i], \
silk_ADD_SAT16( NLSF_Q15[i-1], NDeltaMin_Q15[i] ) );
-
+
/* Last NLSF should be no higher than 1 - NDeltaMin[L] */
<CODE ENDS>
]]></artwork>
@@ -334,13 +334,13 @@
<CODE BEGINS>
b = 0;
}
-
+
- if (resynth && M*eBands[i]-N >= M*eBands[start] && \
(update_lowband || lowband_offset==0))
+ if (resynth && (M*eBands[i]-N >= M*eBands[start] || \
i==start+1) && (update_lowband || lowband_offset==0))
lowband_offset = i;
-
+
+ if (i == start+1)
+ {
+ int n1, n2;
--
⑨