ml4gw.nn.autoencoder.utils
Functions
|
Symmetrically pad or crop a tensor to a target length. |
- ml4gw.nn.autoencoder.utils.match_size(X, target_size)
Symmetrically pad or crop a tensor to a target length.
- Parameters:
X (
Tensor) -- Tensor to resize along its final dimension.target_size (
int) -- Desired size of the final dimension.
- Return type:
Tensor- Returns:
A centered view or padded tensor with the requested final dimension.