Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
18
def
count_padding(sample):
19
return
(sample[
"tokens"
].shape[-1] - sample[
"length"
]).sum()
20
21
22
class
TestDynamicBatch(unittest.TestCase):
Callers
2
test_buffer_dynamic_batch_padding
Method · 0.85
test_stream_dynamic_batch_padding
Method · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected