diff --git a/src/safeds/ml/nn/layers/_convolutional2d_layer.py b/src/safeds/ml/nn/layers/_convolutional2d_layer.py index 97e9476d1..bc4c4d4d7 100644 --- a/src/safeds/ml/nn/layers/_convolutional2d_layer.py +++ b/src/safeds/ml/nn/layers/_convolutional2d_layer.py @@ -5,14 +5,13 @@ from typing import TYPE_CHECKING, Any, Literal from safeds._utils import _structural_hash -from safeds.ml.nn.typing import TensorShape from ._layer import Layer if TYPE_CHECKING: from torch import nn - from safeds.ml.nn.typing import ModelImageSize + from safeds.ml.nn.typing import ModelImageSize, TensorShape class Convolutional2DLayer(Layer): diff --git a/src/safeds/ml/nn/layers/_pooling2d_layer.py b/src/safeds/ml/nn/layers/_pooling2d_layer.py index 0c3058c38..b9e277d74 100644 --- a/src/safeds/ml/nn/layers/_pooling2d_layer.py +++ b/src/safeds/ml/nn/layers/_pooling2d_layer.py @@ -134,7 +134,7 @@ def __sizeof__(self) -> int: + sys.getsizeof(self._padding) ) - def get_parameter_count(self, input_size: TensorShape) -> int: + def get_parameter_count(self, input_size: TensorShape) -> int: # noqa: ARG002 return 0 diff --git a/src/safeds/ml/nn/typing/_tensor_shape.py b/src/safeds/ml/nn/typing/_tensor_shape.py index 1448739b6..6e87c0bd1 100644 --- a/src/safeds/ml/nn/typing/_tensor_shape.py +++ b/src/safeds/ml/nn/typing/_tensor_shape.py @@ -41,7 +41,7 @@ def get_size(self, dimension: int | None = None) -> int: #TODO maybe add error message indicating that the dimension is out of range return 0 if(dimension is None): - return self._dims + return self._dims[0] return self._dims[dimension] def __hash__(self) -> int: