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

[Util] support more int types in gen_finn_dt_tensor

parent c49f4206
No related branches found
No related tags found
No related merge requests found
......@@ -185,8 +185,10 @@ def gen_finn_dt_tensor(finn_dt, tensor_shape):
tensor_values = np.random.randint(2, size=tensor_shape)
elif finn_dt == DataType.TERNARY:
tensor_values = np.random.randint(-1, high=1, size=tensor_shape)
elif finn_dt == DataType.INT2:
tensor_values = np.random.randint(-2, high=1, size=tensor_shape)
elif "INT" in finn_dt.name:
tensor_values = np.random.randint(
finn_dt.min(), high=finn_dt.max(), size=tensor_shape
)
else:
raise ValueError(
"Datatype {} is not supported, no tensor could be generated".format(finn_dt)
......
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