Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Yu-Zhewen committed May 11, 2024
1 parent b7c101c commit a274ef1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion fpgaconvnet/models/layers/ConvolutionPointwiseSparseLayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,5 +216,7 @@ def resource(self):
rsc = super().resource()
# when sparsity occurs, the crossbar in sparse_vector_dot already acts as a squeeze
squeeze_rsc = self.modules['squeeze'].rsc()
rsc = { rsc_type: rsc[rsc_type] - squeeze_rsc[rsc_type] for rsc_type in ["LUT", "FF", "DSP", "BRAM"] }
for rsc_type in squeeze_rsc.keys():
if rsc_type in rsc.keys():
rsc[rsc_type] -= squeeze_rsc[rsc_type]
return rsc
4 changes: 3 additions & 1 deletion fpgaconvnet/models/layers/ConvolutionSparseLayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ def resource(self):
rsc = super().resource()
# when sparsity occurs, the crossbar in sparse_vector_dot already acts as a squeeze
squeeze_rsc = self.modules['squeeze'].rsc()
rsc = { rsc_type: rsc[rsc_type] - squeeze_rsc[rsc_type] for rsc_type in ["LUT", "FF", "DSP", "BRAM"] }
for rsc_type in squeeze_rsc.keys():
if rsc_type in rsc.keys():
rsc[rsc_type] -= squeeze_rsc[rsc_type]
return rsc

0 comments on commit a274ef1

Please sign in to comment.