(self, args)
| 64 | |
| 65 | class Plot: |
| 66 | def __init__(self, args): |
| 67 | self.args = args |
| 68 | self.result_dict = defaultdict(lambda: dict(bsz=[], seq_len=[], result={})) |
| 69 | |
| 70 | with open(self.args.csv_file, newline="") as csv_file: |
| 71 | reader = csv.DictReader(csv_file) |
| 72 | for row in reader: |
| 73 | model_name = row["model"] |
| 74 | self.result_dict[model_name]["bsz"].append(int(row["batch_size"])) |
| 75 | self.result_dict[model_name]["seq_len"].append(int(row["sequence_length"])) |
| 76 | if can_convert_to_int(row["result"]): |
| 77 | # value is not None |
| 78 | self.result_dict[model_name]["result"][ |
| 79 | (int(row["batch_size"]), int(row["sequence_length"])) |
| 80 | ] = int(row["result"]) |
| 81 | elif can_convert_to_float(row["result"]): |
| 82 | # value is not None |
| 83 | self.result_dict[model_name]["result"][ |
| 84 | (int(row["batch_size"]), int(row["sequence_length"])) |
| 85 | ] = float(row["result"]) |
| 86 | |
| 87 | def plot(self): |
| 88 | fig, ax = plt.subplots() |
nothing calls this directly
no test coverage detected