torch_ecg.utils.compute_avgpool_output_shape¶
- torch_ecg.utils.compute_avgpool_output_shape(input_shape: Sequence[Optional[int]], kernel_size: Union[Sequence[int], int] = 1, stride: Union[Sequence[int], int] = 1, padding: Union[Sequence[int], int] = 0, channel_last: bool = False) Tuple[Optional[int]] [source]¶
Compute the output shape of a avgpool layer.
- Parameters
input_shape (Sequence[Union[int, None]]) – Shape of an input
Tensor
. The first dimension is the batch dimension, which is allowed to be None.kernel_size (int or Sequence[int], default 1) – Kernel size (filter size) of the layer, should be compatible with input_shape.
stride (int or Sequence[int], default 1) – Stride (down-sampling length) of the layer, should be compatible with input_shape.
padding (int or Sequence[int], default 0) – Padding length(s) of the layer, should be compatible with input_shape.
channel_last (bool, default False) – Whether the channel dimension is the last dimension, or the second dimension (the first is the batch dimension by convention).
- Returns
output_shape – Shape of the output
Tensor
.- Return type