| 163 | |
| 164 | def to_json(self, json_path: str): |
| 165 | class SimpleJSONEncoder(json.JSONEncoder): |
| 166 | def default(self, obj): |
| 167 | if isinstance(obj, torch.dtype): |
| 168 | return str(obj) |
| 169 | return super().default(obj) |
| 170 | |
| 171 | # Ensure the directory exists |
| 172 | os.makedirs(os.path.dirname(json_path), exist_ok=True) |
nothing calls this directly
no outgoing calls
no test coverage detected