From 2e1d4528c14f41ea247f8e5b6dd9bc0f7c459f86 Mon Sep 17 00:00:00 2001
From: Yaman Umuroglu <maltanar@gmail.com>
Date: Fri, 7 Feb 2020 18:15:45 +0100
Subject: [PATCH] [Util] convert to tuple in gen tensor

---
 src/finn/util/basic.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/finn/util/basic.py b/src/finn/util/basic.py
index ec5d31f63..44a44ae12 100644
--- a/src/finn/util/basic.py
+++ b/src/finn/util/basic.py
@@ -139,6 +139,8 @@ def pad_tensor_to_multiple_of(ndarray, pad_to_dims, val=0, distr_pad=False):
 
 def gen_finn_dt_tensor(finn_dt, tensor_shape):
     """Generates random tensor in given shape and with given FINN DataType"""
+    if type(tensor_shape) == list:
+        tensor_shape = tuple(tensor_shape)
     if finn_dt == DataType.BIPOLAR:
         tensor_values = np.random.randint(2, size=tensor_shape)
         tensor_values = 2 * tensor_values - 1
-- 
GitLab