Skip to content

Commit ff1799c

Browse files
committedFeb 24, 2025·
Update error messages
Remove "which should never happen" from them
1 parent 2ae7085 commit ff1799c

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed
 

‎sinabs/backend/dynapcnn/dynapcnnnetwork_module.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def get_dynapcnnlayers_edges(self) -> Set[Edge]:
170170
171171
Returns
172172
----------
173-
- dcnnl_edges: a set of edges using the IDs of `DynapcnnLayer` instances. These edges describe the computational
173+
- dcnnl_edges (Set): a set of edges using the IDs of `DynapcnnLayer` instances. These edges describe the computational
174174
graph implemented by the layers of the model (i.e., how the `DynapcnnLayer` instances address each other).
175175
"""
176176
dcnnl_edges = set()

‎sinabs/backend/dynapcnn/exceptions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Set, Tuple, Type
22

33
default_invalid_structure_string = (
4-
"This should never happen, but is most likely due to an unsupported SNN "
4+
"Invalid structure found. This is most likely due to an unsupported SNN "
55
"architecture. In general, a dynapcnn network should consist of groups of "
66
"a weight layer (conv or linear), a spiking layer (IAFSqueeze), and "
77
"optionally a pooling layer."

‎sinabs/backend/dynapcnn/sinabs_edges_handler.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -984,23 +984,23 @@ def verify_layer_info(
984984
for idx, info in dynapcnn_layer_info.items():
985985
if not "conv" in info:
986986
raise InvalidGraphStructure(
987-
f"DynapCNN layer {idx} has no weight assigned, which should "
988-
"never happen. " + default_invalid_structure_string
987+
f"DynapCNN layer {idx} has no weight assigned. "
988+
+ default_invalid_structure_string
989989
)
990990
if not "neuron" in info:
991991
raise InvalidGraphStructure(
992-
f"DynapCNN layer {idx} has no spiking layer assigned, which "
993-
"should never happen. " + default_invalid_structure_string
992+
f"DynapCNN layer {idx} has no spiking layer assigned. "
993+
+ default_invalid_structure_string
994994
)
995995
if not "destinations" in info:
996996
raise InvalidGraphStructure(
997-
f"DynapCNN layer {idx} has no destination info assigned, which "
998-
"should never happen. " + default_invalid_structure_string
997+
f"DynapCNN layer {idx} has no destination info assigned. "
998+
+ default_invalid_structure_string
999999
)
10001000
if edge_counts is not None:
10011001
# Make sure there are as many layers as edges from weight to neuron
10021002
if edge_counts.get("weight-neuron", 0) - len(dynapcnn_layer_info) > 0:
10031003
raise InvalidGraphStructure(
1004-
"Not all weight-to-neuron edges have been processed, which "
1005-
"should never happen. " + default_invalid_structure_string
1004+
"Not all weight-to-neuron edges have been processed. "
1005+
+ default_invalid_structure_string
10061006
)

0 commit comments

Comments
 (0)
Please sign in to comment.