Skip to content

Commit fad667f

Browse files
committed
fix linting problems
1 parent 4743ae2 commit fad667f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/qonnx/core/datatype.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def to_numpy_dt(self):
144144
def get_canonical_name(self):
145145
return "FLOAT32"
146146

147+
147148
class Float16Type(BaseDataType):
148149
def bitwidth(self):
149150
return 16
@@ -175,6 +176,7 @@ def to_numpy_dt(self):
175176
def get_canonical_name(self):
176177
return "FLOAT16"
177178

179+
178180
class IntType(BaseDataType):
179181
def __init__(self, bitwidth, signed):
180182
super().__init__()

tests/analysis/test_matmul_mac_cost.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@
2727
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828

2929

30-
import pytest
31-
import qonnx
3230
from pkgutil import get_data
31+
3332
import qonnx.util.inference_cost as infc
34-
from qonnx.util.cleanup import cleanup_model
3533
from qonnx.core.modelwrapper import ModelWrapper
34+
from qonnx.util.cleanup import cleanup_model
3635

3736

3837
def test_matmul_mac_cost():
39-
raw_model = get_data("qonnx","data/onnx/matmul_update/sdp.onnx")
38+
raw_model = get_data("qonnx", "data/onnx/matmul_update/sdp.onnx")
4039
model = ModelWrapper(raw_model)
4140
cleaned_model = cleanup_model(model)
42-
# Two Matmul layers with shape (i_shape, w_shape, o_shape), L1: ([4, 64, 32], [4, 32, 64], [4, 64, 64]) and L2: ([4, 64, 64], [4, 64, 32], [4, 64, 32])
41+
# Two Matmul layers with shape (i_shape, w_shape, o_shape), L1: ([4, 64, 32], [4, 32, 64], [4, 64, 64])
42+
# and L2: ([4, 64, 64], [4, 64, 32], [4, 64, 32])
4343
inf_cost_dict = infc.inference_cost(cleaned_model, discount_sparsity=False)
44-
mac_cost = inf_cost_dict['op_mac_FLOAT32_FLOAT32'] # Expected mac cost 4*32*64*64 + 4*64*64*32 = 1048576
44+
mac_cost = inf_cost_dict["op_mac_FLOAT32_FLOAT32"] # Expected mac cost 4*32*64*64 + 4*64*64*32 = 1048576
4545
assert mac_cost == 1048576.0, "Error: discrepancy in mac cost."

0 commit comments

Comments
 (0)