Skip to content

Commit

Permalink
docs: remove pointless docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed May 29, 2024
1 parent a3c8811 commit 82322a9
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 140 deletions.
58 changes: 0 additions & 58 deletions src/safeds/ml/nn/layers/_convolutional2d_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,6 @@ def _set_input_size(self, input_size: int | ModelImageSize) -> None:
self._output_size = None

def __hash__(self) -> int:
"""
Return a deterministic hash value for this convolutional 2d layer.
Returns
-------
hash:
the hash value
"""
return _structural_hash(
self._output_channel,
self._kernel_size,
Expand All @@ -209,19 +201,6 @@ def __hash__(self) -> int:
)

def __eq__(self, other: object) -> bool:
"""
Compare two convolutional 2d layer.
Parameters
----------
other:
The convolutional 2d layer to compare to.
Returns
-------
equals:
Whether the two convolutional 2d layer are the same.
"""
if not isinstance(other, Convolutional2DLayer) or isinstance(other, ConvolutionalTranspose2DLayer):
return NotImplemented
return (self is other) or (
Expand All @@ -234,14 +213,6 @@ def __eq__(self, other: object) -> bool:
)

def __sizeof__(self) -> int:
"""
Return the complete size of this object.
Returns
-------
size:
Size of this object in bytes.
"""
return (
sys.getsizeof(self._output_channel)
+ sys.getsizeof(self._kernel_size)
Expand Down Expand Up @@ -336,30 +307,9 @@ def output_size(self) -> ModelImageSize:
return self._output_size

def __hash__(self) -> int:
"""
Return a deterministic hash value for this convolutional transpose 2d layer.
Returns
-------
hash:
the hash value
"""
return _structural_hash(super().__hash__(), self._output_padding)

def __eq__(self, other: object) -> bool:
"""
Compare two convolutional transpose 2d layer.
Parameters
----------
other:
The convolutional transpose 2d layer to compare to.
Returns
-------
equals:
Whether the two convolutional transpose 2d layer are the same.
"""
if not isinstance(other, ConvolutionalTranspose2DLayer):
return NotImplemented
return (self is other) or (
Expand All @@ -373,12 +323,4 @@ def __eq__(self, other: object) -> bool:
)

def __sizeof__(self) -> int:
"""
Return the complete size of this object.
Returns
-------
size:
Size of this object in bytes.
"""
return sys.getsizeof(self._output_padding) + super().__sizeof__()
29 changes: 0 additions & 29 deletions src/safeds/ml/nn/layers/_flatten_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,41 +92,12 @@ def _set_input_size(self, input_size: int | ModelImageSize) -> None:
self._output_size = None

def __hash__(self) -> int:
"""
Return a deterministic hash value for this flatten layer.
Returns
-------
hash:
the hash value
"""
return _structural_hash(self._input_size, self._output_size)

def __eq__(self, other: object) -> bool:
"""
Compare two flatten layer.
Parameters
----------
other:
The flatten layer to compare to.
Returns
-------
equals:
Whether the two flatten layer are the same.
"""
if not isinstance(other, FlattenLayer):
return NotImplemented
return (self is other) or (self._input_size == other._input_size and self._output_size == other._output_size)

def __sizeof__(self) -> int:
"""
Return the complete size of this object.
Returns
-------
size:
Size of this object in bytes.
"""
return sys.getsizeof(self._input_size) + sys.getsizeof(self._output_size)
24 changes: 0 additions & 24 deletions src/safeds/ml/nn/layers/_forward_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,40 +82,16 @@ def _set_input_size(self, input_size: int | ModelImageSize) -> None:
self._input_size = input_size

def __hash__(self) -> int:
"""
Return a deterministic hash value for this forward layer.
Returns
-------
hash:
the hash value
"""
return _structural_hash(self._input_size, self._output_size)

def __eq__(self, other: object) -> bool:
"""
Compare two forward layer instances.
Returns
-------
equals:
'True' if input and output size are equal, 'False' otherwise.
"""
if not isinstance(other, ForwardLayer):
return NotImplemented
if self is other:
return True
return self._input_size == other._input_size and self._output_size == other._output_size

def __sizeof__(self) -> int:
"""
Return the complete size of this object.
Returns
-------
size:
Size of this object in bytes.
"""
import sys

return sys.getsizeof(self._input_size) + sys.getsizeof(self._output_size)
Expand Down
29 changes: 0 additions & 29 deletions src/safeds/ml/nn/layers/_pooling2d_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,6 @@ def _set_input_size(self, input_size: int | ModelImageSize) -> None:
self._output_size = None

def __hash__(self) -> int:
"""
Return a deterministic hash value for this pooling 2d layer.
Returns
-------
hash:
the hash value
"""
return _structural_hash(
self._strategy,
self._kernel_size,
Expand All @@ -120,19 +112,6 @@ def __hash__(self) -> int:
)

def __eq__(self, other: object) -> bool:
"""
Compare two pooling 2d layer.
Parameters
----------
other:
The pooling 2d layer to compare to.
Returns
-------
equals:
Whether the two pooling 2d layer are the same.
"""
if not isinstance(other, type(self)):
return NotImplemented
return (self is other) or (
Expand All @@ -145,14 +124,6 @@ def __eq__(self, other: object) -> bool:
)

def __sizeof__(self) -> int:
"""
Return the complete size of this object.
Returns
-------
size:
Size of this object in bytes.
"""
return (
sys.getsizeof(self._input_size)
+ sys.getsizeof(self._output_size)
Expand Down

0 comments on commit 82322a9

Please sign in to comment.