Skip to content

Commit 1a49cfb

Browse files
vamsimanchalacopybara-github
authored andcommitted
Rewrite the CHIRP model code so it can be lowered to a supported StableHLO/MHLO IR.
PiperOrigin-RevId: 723162070
1 parent 827f0e1 commit 1a49cfb

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

chirp/audio_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ def ema_conv1d(
401401
if conv_width == -1:
402402
conv_width = xs.shape[1]
403403

404-
left_pad = jnp.repeat(xs[:, 0:1], conv_width - 1, axis=1)
404+
xs_slice = lax.slice(xs, (0, 0, 0), (xs.shape[0], 1, xs.shape[2]), (1, 1, 1))
405+
left_pad = jnp.repeat(xs_slice, conv_width - 1, axis=1)
405406
padded_inp = jnp.concatenate([left_pad, xs], axis=1)
406407

407408
kernel = jnp.array(

chirp/train_tests/frontend_test.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,6 @@ def test_inverse(self, module_type, inverse_module_type, module_kwargs):
153153
"kernel_size": 64,
154154
},
155155
},
156-
{
157-
"module_type": frontend.ISTFT,
158-
"module_kwargs": {
159-
"stride": 64,
160-
},
161-
"signal_shape": (1, 25, 64),
162-
},
163156
{
164157
"module_type": frontend.InverseLearnedFrontend,
165158
"module_kwargs": {

0 commit comments

Comments
 (0)