MCPcopy Create free account
hub / github.com/Turing-Project/WriteGPT / _pad

Function _pad

LanguageNetwork/BERT/sentence_encoder.py:58–62  ·  view source on GitHub ↗
(data, pad_id, width=-1)

Source from the content-addressed store, hash-verified

56
57
58def _pad(data, pad_id, width=-1):
59 if width == -1:
60 width = max(len(d) for d in data)
61 rtn_data = [d + [pad_id] * (width - len(d)) for d in data]
62 return rtn_data
63
64
65def gen_bert_vector(data, pad_size=200, ):

Callers 1

gen_bert_vectorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected