MCPcopy Create free account
hub / github.com/ml-explore/mlx-data / count_padding

Function count_padding

python/tests/test_dynamic_batch.py:18–19  ·  view source on GitHub ↗
(sample)

Source from the content-addressed store, hash-verified

16
17
18def count_padding(sample):
19 return (sample["tokens"].shape[-1] - sample["length"]).sum()
20
21
22class TestDynamicBatch(unittest.TestCase):

Calls

no outgoing calls

Tested by

no test coverage detected