Created
May 19, 2023 16:51
-
-
Save daniil-lyakhov/0cbf6111785b52aff7ffbade09ed8f2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import json | |
from collections import defaultdict | |
import numpy as np | |
def main(): | |
path = sys.argv[1] | |
with open(path, 'r') as f: | |
data = json.load(f) | |
aggregated = defaultdict(list) | |
for elem in data: | |
if 'args' in elem and 'op_name' in elem['args']: | |
aggregated[elem['args']['op_name']].append(elem['dur']) | |
print('Type_name,len,mean_val') | |
for type_name, val in aggregated.items(): | |
print(type_name, len(val), np.mean(val).astype(np.float16), sep=',\t') | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment