Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pegasus_layout and zephyr_layout return out of range values #239

Open
mahdiehmalekian opened this issue May 29, 2024 · 0 comments
Open

pegasus_layout and zephyr_layout return out of range values #239

mahdiehmalekian opened this issue May 29, 2024 · 0 comments

Comments

@mahdiehmalekian
Copy link

Description
dnx.pegasus_layout and dnx.zephyr_layout return out of range values

To Reproduce

p2 = dnx.pegasus_graph(2)
p2_layout = dnx.pegasus_layout(p2)
p2_layout_arr = np.array([p2_layout[v] for v in p2.nodes()])
x_min, y_min = np.round(np.min(p2_layout_arr, axis=0), 2)
x_max, y_max = np.round(np.max(p2_layout_arr, axis=0), 2)
print(f'x range: [{x_min}, {x_max}], y_range: [{y_min}, {y_max}]')

The output is x range: [0.09, 0.87], y_range: [-0.87, -0.09]

Similarly,

z2 = dnx.zephyr_graph(2)
z2_layout = dnx.zephyr_layout(z2)
z2_layout_arr = np.array([z2_layout[v] for v in z2.nodes()])
x_min, y_min = np.round(np.min(z2_layout_arr, axis=0), 2)
x_max, y_max = np.round(np.max(z2_layout_arr, axis=0), 2)
print(f'x range: [{x_min}, {x_max}], y_range: [{y_min}, {y_max}]')

The output is x range: [0.02, 4.84], y_range: [-4.84, -0.02]

Expected behavior
x values are expected to fall in [0, 1] and y values are expected to fall in [-1, 0]

Additional context
I have made a PR here to address this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant