Skip to content
Snippets Groups Projects
Commit 526a872b authored by bmccolm's avatar bmccolm
Browse files

making zip opbject iterable in resource.py

parent 2ac47b43
No related branches found
No related tags found
Loading
...@@ -81,8 +81,8 @@ class Resource(object): ...@@ -81,8 +81,8 @@ class Resource(object):
assert len(buf_capacity_list) == len(buf_unit_static_cost_list) assert len(buf_capacity_list) == len(buf_unit_static_cost_list)
assert len(buf_capacity_list) == len(para_count_list) assert len(buf_capacity_list) == len(para_count_list)
self.bufs = [Buffer(*t) for t in zip(buf_capacity_list, \ self.bufs = [Buffer(*t) for t in list(zip(buf_capacity_list, \
buf_access_cost_list, buf_unit_static_cost_list)] buf_access_cost_list, buf_unit_static_cost_list))]
self.num_levels = len(self.bufs) self.num_levels = len(self.bufs)
...@@ -112,8 +112,8 @@ class Resource(object): ...@@ -112,8 +112,8 @@ class Resource(object):
# LMEI always assume square-shape array, could change later # LMEI always assume square-shape array, could change later
array_width = [para_count_list[i] if array_dim[i] == 1 else int(math.sqrt(para_count_list[i])) for i in range(self.num_levels)] array_width = [para_count_list[i] if array_dim[i] == 1 else int(math.sqrt(para_count_list[i])) for i in range(self.num_levels)]
self.paras = [Parallelism(*t) for t in zip(para_count_list, \ self.paras = [Parallelism(*t) for t in list(zip(para_count_list, \
partition_mode, array_access_costs, array_dim, array_width)] partition_mode, array_access_costs, array_dim, array_width))]
self.access_cost = buf_access_cost_list self.access_cost = buf_access_cost_list
# If list does not contain 3 separate access costs for (inputs, weights, psum) # If list does not contain 3 separate access costs for (inputs, weights, psum)
# assume they all have the same cost # assume they all have the same cost
......
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