Created
November 19, 2021 17:47
-
-
Save lgray/6ca8febbfab20d4703f87991b0aee8d7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 torch | |
| from torch_cmspepr.dataset import TauDataset | |
| import json | |
| from tqdm import tqdm | |
| dataset = TauDataset("/mnt/d/mldata/hgcalml/npzs_all") | |
| out_list = [] | |
| for i, data in tqdm(enumerate(dataset[:1000])): | |
| out_list.append({ | |
| "features__0": { "content": data.x.flatten().tolist(), "shape": list(data.x.size()) }, | |
| "batch__0": { "content": torch.zeros((data.x.size()[0])).tolist(), "shape": [data.x.size()[0]] }, | |
| }) | |
| with open("perfdata.json", "w") as fout: | |
| json.dump({"data": out_list}, fout) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment