Skip to content
Snippets Groups Projects
Commit b7feba38 authored by Frans Skarman's avatar Frans Skarman :tropical_fish: Committed by Oscar Gustafsson
Browse files

Remove debug prints

parent df17cad4
No related branches found
No related tags found
1 merge request!195Unfolding
...@@ -1542,14 +1542,6 @@ class SFG(AbstractOperation): ...@@ -1542,14 +1542,6 @@ class SFG(AbstractOperation):
f"{new_ops[layer][op_idx].graph_id}_{suffix}" f"{new_ops[layer][op_idx].graph_id}_{suffix}"
) )
def sanity_check():
all_ops = [op for op_list in new_ops for op in op_list]
cmul201 = [
op for op in all_ops if op.graph_id == GraphID("cmul2_0_1")
]
if cmul201:
print(f"NOW: {cmul201[0]}")
# Walk through the operations, replacing delay nodes with connections # Walk through the operations, replacing delay nodes with connections
for layer in range(factor): for layer in range(factor):
for op_idx, op in enumerate(self.operations): for op_idx, op in enumerate(self.operations):
...@@ -1625,14 +1617,6 @@ class SFG(AbstractOperation): ...@@ -1625,14 +1617,6 @@ class SFG(AbstractOperation):
target_output target_output
) )
print(
f"Connecting {new_ops[layer][op_idx].name} <-"
f" {target_output.operation.name} ({target_output.operation.graph_id})"
)
print(f" |>{new_ops[layer][op_idx]}")
print(f" |<{target_output.operation}")
sanity_check()
all_ops = [op for op_list in new_ops for op in op_list] all_ops = [op for op_list in new_ops for op in op_list]
# To get the input order correct, we need to know the input order in the original # To get the input order correct, we need to know the input order in the original
...@@ -1663,12 +1647,6 @@ class SFG(AbstractOperation): ...@@ -1663,12 +1647,6 @@ class SFG(AbstractOperation):
) )
) )
print("All ops: ")
print(*all_ops, sep="\n")
print("All outputs: ")
print(*all_outputs, sep="\n")
# Sanity check to ensure that no duplicate graph IDs have been created # Sanity check to ensure that no duplicate graph IDs have been created
ids = [op.graph_id for op in all_ops] ids = [op.graph_id for op in all_ops]
assert len(ids) == len(set(ids)) assert len(ids) == len(set(ids))
......
...@@ -1662,16 +1662,10 @@ class TestUnfold: ...@@ -1662,16 +1662,10 @@ class TestUnfold:
for _ in sfg.inputs for _ in sfg.inputs
] ]
print("In: ")
print(input_list)
sim = Simulation(sfg, input_list) sim = Simulation(sfg, input_list)
sim.run() sim.run()
ref = sim.results ref = sim.results
print("out: ")
print(list(ref[ResultKey("0")]))
# We have i copies of the inputs, each sourcing their input from the orig # We have i copies of the inputs, each sourcing their input from the orig
unfolded_input_lists = [ unfolded_input_lists = [
[] for _ in range(len(sfg.inputs) * factor) [] for _ in range(len(sfg.inputs) * factor)
...@@ -1687,10 +1681,6 @@ class TestUnfold: ...@@ -1687,10 +1681,6 @@ class TestUnfold:
sim.run() sim.run()
unfolded_results = sim.results unfolded_results = sim.results
print("ref out: ")
print("0: ", unfolded_results[ResultKey("0")])
print("1: ", unfolded_results[ResultKey("1")])
for n, _ in enumerate(sfg.outputs): for n, _ in enumerate(sfg.outputs):
# Outputs for an original output # Outputs for an original output
ref_values = list(ref[ResultKey(f"{n}")]) ref_values = list(ref[ResultKey(f"{n}")])
...@@ -1698,7 +1688,6 @@ class TestUnfold: ...@@ -1698,7 +1688,6 @@ class TestUnfold:
# Output n will be split into `factor` output ports, compute the # Output n will be split into `factor` output ports, compute the
# indicies where we find the outputs # indicies where we find the outputs
out_indices = [n + k * len(sfg.outputs) for k in range(factor)] out_indices = [n + k * len(sfg.outputs) for k in range(factor)]
print("out indices: ", out_indices)
u_values = [ u_values = [
[ [
unfolded_results[ResultKey(f"{idx}")][k] unfolded_results[ResultKey(f"{idx}")][k]
...@@ -1707,13 +1696,8 @@ class TestUnfold: ...@@ -1707,13 +1696,8 @@ class TestUnfold:
for k in range(int(NUM_TESTS)) for k in range(int(NUM_TESTS))
] ]
print("u_values: ", u_values)
flat_u_values = list(itertools.chain.from_iterable(u_values)) flat_u_values = list(itertools.chain.from_iterable(u_values))
print("ref_values: ", ref_values)
print("flat u_values: ", flat_u_values)
assert flat_u_values == ref_values assert flat_u_values == ref_values
def test_value_error(self, sfg_two_inputs_two_outputs: SFG): def test_value_error(self, sfg_two_inputs_two_outputs: SFG):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment