MCPcopy Create free account
hub / github.com/google-research/language / as_fixed_length_tensor

Method as_fixed_length_tensor

language/realm/featurization.py:303–305  ·  view source on GitHub ↗
(seq, seq_len)

Source from the content-addressed store, hash-verified

301 mlm_targets = query_mask_features['masked_token_ids']
302
303 def as_fixed_length_tensor(seq, seq_len):
304 result = truncate_or_pad(seq, seq_len, pad_val=0)
305 return tf.constant(result)
306
307 mlm_mask = as_fixed_length_tensor(mlm_mask, self.max_masks)
308 mlm_positions = as_fixed_length_tensor(mlm_positions, self.max_masks)

Callers

nothing calls this directly

Calls 2

truncate_or_padFunction · 0.85
constantMethod · 0.80

Tested by

no test coverage detected