Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ml-explore/mlx-data
/ random_sample
Function
random_sample
python/tests/test_dynamic_batch.py:13–15 ·
view source on GitHub ↗
(idx)
Source
from the content-addressed store, hash-verified
11
12
13
def
random_sample(idx):
14
N = int(np.random.rand() * (1024 - 64) + 64)
15
return
{
"tokens"
: np.random.rand(N),
"length"
: N,
"idx"
: idx}
16
17
18
def
count_padding(sample):
Callers
6
test_buffer_dynamic_batch_padding
Method · 0.85
test_stream_dynamic_batch_padding
Method · 0.85
test_buffer_dynamic_batch_indexing
Method · 0.85
test_stream_dynamic_batch_indexing
Method · 0.85
test_stream_dynamic_batch_max_token_size
Method · 0.85
test_stream_dynamic_batch_min_token_size
Method · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected