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

Make gen_finn_dt_tensor consider the numpy type for INT and FIXED types #118

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iksnagreb
Copy link
Contributor

When the FINN datatype is, for example, UINT64, np.random.randint still implicitly defaults to np.int64, making the high=finn_dt.max() + 1 exceed the valid range: ValueError: high is out of bounds for int64. This happened to me in the step_make_pynq_driver of a FINN build of a Gather/Lookup node where the index input has been annotated to UINT64.

I think, the most generic solution to this is specifying the numpy datatype corresponding to the FINN datatype as an additional dtype= argument to the function call. I am not sure whether it makes sense to add this to all the other cases as well, i.e., to BINARY, BIPOLAR and FLOAT32.

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

Successfully merging this pull request may close these issues.

1 participant