MCPcopy Create free account
hub / github.com/PKU-Alignment/align-anything / right_padding

Function right_padding

align_anything/utils/tools.py:67–68  ·  view source on GitHub ↗
(sequences: list[torch.Tensor], padding_value: Number)

Source from the content-addressed store, hash-verified

65
66
67def right_padding(sequences: list[torch.Tensor], padding_value: Number) -> torch.Tensor:
68 return pad_sequence(sequences, batch_first=True, padding_value=padding_value)
69
70
71def left_padding(sequences: list[torch.Tensor], padding_value: Number) -> torch.Tensor:

Callers 14

__call__Method · 0.90
__call__Method · 0.90
__call__Method · 0.90
__call__Method · 0.90
__call__Method · 0.90
__call__Method · 0.90
__call__Method · 0.90
__call__Method · 0.90
__call__Method · 0.90
__call__Method · 0.90
__call__Method · 0.90
__call__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected