trw.layers.crop_or_pad¶
Module Contents¶
Functions¶
|
Crop or pad a tensor to the specified shape ( |
- trw.layers.crop_or_pad.crop_or_pad_fun(x: torch.Tensor, shape: Sequence[int], padding_default_value=0) torch.Tensor¶
Crop or pad a tensor to the specified shape (
NandCexcluded)- Parameters
x – the tensor shape
shape – the shape of x to be returned.
NandCchannels must not be specifiedpadding_default_value – the padding value to be used
- Returns
torch.Tensor