Files
concrete/compiler/tests/stress_tests/experiment.py
2021-12-28 09:03:38 +01:00

33 lines
625 B
Python

from dataclasses import asdict, dataclass
import json
@dataclass
class Replication:
success: bool
details: 'list[str]'
@dataclass
class ExperimentConditions:
bitwidth: int
size: int
args: 'list[int]'
log_manp_max: int
overflow: bool
details: 'list[str]'
@dataclass
class Experiment:
cmd: str
conditions: ExperimentConditions
replications: 'list[Replication]'
code: str
success_rate: float
overflow_rate: float
class Encoder(json.JSONEncoder):
def default(self, z):
try:
return super().default(z)
except:
return asdict(z)