Skip to content

Commit 2f6fee8

Browse files
justinchubyCopilot
andcommitted
test: add bf16 audio padding coverage
Address the reviewer note by exercising Gemma 4 audio padding removal with BFLOAT16 inputs and verifying dtype restoration. Co-authored-by: Copilot <[email protected]>
1 parent d5d802a commit 2f6fee8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎tests/build_graph_test.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import re
2020

21+
import ml_dtypes
2122
import numpy as np
2223
import onnx_ir as ir
2324
import pytest
@@ -1689,6 +1690,7 @@ def test_gemma4_any_to_any_graph(self):
16891690
[
16901691
(ir.DataType.FLOAT, np.float32),
16911692
(ir.DataType.FLOAT16, np.float16),
1693+
(ir.DataType.BFLOAT16, ml_dtypes.bfloat16),
16921694
],
16931695
)
16941696
def test_gemma4_audio_encoder_strips_padding_in_graph(self, dtype, np_dtype):
@@ -1725,6 +1727,7 @@ def forward(self, op, input_features, input_features_mask=None):
17251727
outputs["audio_features"],
17261728
np.concatenate([features[0, :2], features[1, :1]], axis=0),
17271729
)
1730+
assert outputs["audio_features"].dtype == np.dtype(np_dtype)
17281731

17291732
def test_gemma4_unified_multimodal_graph(self):
17301733
"""Build gemma4_unified (gemma-4-12B) encoder-free multimodal model.

0 commit comments

Comments
 (0)