MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / _is_batch_full

Function _is_batch_full

utils/__init__.py:79–86  ·  view source on GitHub ↗
(batch, num_tokens, max_tokens, max_sentences)

Source from the content-addressed store, hash-verified

77
78
79def _is_batch_full(batch, num_tokens, max_tokens, max_sentences):
80 if len(batch) == 0:
81 return 0
82 if len(batch) == max_sentences:
83 return 1
84 if num_tokens > max_tokens:
85 return 1
86 return 0
87
88
89def batch_by_size(

Callers 1

batch_by_sizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected