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

[Util] cover the full DataType range, high=max+1

parent 8453c02e
No related branches found
No related tags found
No related merge requests found
......@@ -183,11 +183,9 @@ def gen_finn_dt_tensor(finn_dt, tensor_shape):
tensor_values = 2 * tensor_values - 1
elif finn_dt == DataType.BINARY:
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 "INT" in finn_dt.name:
elif "INT" in finn_dt.name or finn_dt == DataType.TERNARY:
tensor_values = np.random.randint(
finn_dt.min(), high=finn_dt.max(), size=tensor_shape
finn_dt.min(), high=finn_dt.max() + 1, size=tensor_shape
)
else:
raise ValueError(
......
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