mirror of
https://github.com/InternLM/InternBootcamp.git
synced 2026-04-19 12:58:04 +00:00
Fix: Resolve 'low >= high' error in circuit generation - Fixed np.random.randint(2, 2) error when num_additional_edges_max == 1 - Added proper handling for cases where only 1 additional edge is possible - Prevents continuous failures when generating circuits with min_nodes=3
This commit is contained in:
parent
a32ce9b4f6
commit
a3b5982e33
1 changed files with 3 additions and 1 deletions
|
|
@ -50,8 +50,10 @@ class CoreCircuit:
|
|||
# print(f"[DEBUG libcircuit] num_additional_edges_max: {num_additional_edges_max}")
|
||||
|
||||
num_target_additional_edges = 0
|
||||
if num_additional_edges_max > 0:
|
||||
if num_additional_edges_max > 1:
|
||||
num_target_additional_edges = np.random.randint(2, num_additional_edges_max + 1)
|
||||
elif num_additional_edges_max == 1:
|
||||
num_target_additional_edges = 1
|
||||
# print(f"[DEBUG libcircuit] num_target_additional_edges: {num_target_additional_edges}")
|
||||
|
||||
existing_pairs = set()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue