SizeMixin#

class torch_ecg.utils.SizeMixin[source]#

Bases: object

Mixin class for size related methods

compute_features_output_shape(*args: Any, **kwargs: Any) Sequence[int | None][source]#

Compute the output shape of the features.

By default, this is the same as the output shape of the model. For backbones with pooling and classification heads, this should be overridden to return the shape of the features before global pooling.

Parameters:
  • *args (Any) – Positional arguments passed to compute_output_shape.

  • **kwargs (Any) – Keyword arguments passed to compute_output_shape.

Returns:

output_shape – Output shape of the features.

Return type:

sequence

property module_size: int#

Size of trainable parameters in the model in terms of number of parameters.

property module_size_: str#

Size of trainable parameters in the model in terms of memory capacity.

property sizeof: int#

Size of the model in terms of number of parameters, including non-trainable parameters and buffers.

property sizeof_: str#

Size of the model in terms of memory capacity, including non-trainable parameters and buffers.