Skip to content
Snippets Groups Projects
Commit b6220fc3 authored by Yaman Umuroglu's avatar Yaman Umuroglu
Browse files

[Util] start working on numpy_to_hls_code

parent 701f1ac6
No related branches found
No related tags found
No related merge requests found
from finn.core.utils import pack_innermost_dim_as_hex_string
def numpy_to_hls_code(ndarray, dtype, pack_innermost_dim=True):
hls_dtype = dtype.get_hls_datatype_str()
if pack_innermost_dim:
idimlen = ndarray.shape[-1]
ndarray = pack_innermost_dim_as_hex_string(ndarray, dtype, idimlen)
hls_dtype = "ap_uint<%d>" % (idimlen * dtype.bitwidth())
return hls_dtype
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