module documentation
Undocumented
Function | pad |
Pad a tensor's size to a multiple of a number. |
def pad_to_multiple(tensor:
torch.Tensor
, multiple: int
, *, mode: str
, value: float
= 0.0) -> torch.Tensor
:
(source)
¶
Pad a tensor's size to a multiple of a number.
Parameters | |
tensor:torch.Tensor | Tensor to pad. |
multiple:int | Size multiple to pad to. |
mode:str | Padding mode; see torch.nn.functional.pad . |
value:float | Padding value; see torch.nn.functional.pad . |
Returns | |
torch.Tensor | Padded tensor, or the original tensor if no padding was needed. |