aboutsummaryrefslogtreecommitdiff
path: root/nneq.py
diff options
context:
space:
mode:
authorericmarin <maarin.eric@gmail.com>2026-03-23 17:53:21 +0100
committerericmarin <maarin.eric@gmail.com>2026-03-25 10:23:07 +0100
commit689c34076d08e59b1382864f9efcd983c8665ae5 (patch)
treeb76f3eb0ece697cb042d578a0a11800bd13a8dc8 /nneq.py
parent4a9b66faae8bf362849b961ac2bf5dedc079c6ce (diff)
downloadvein-689c34076d08e59b1382864f9efcd983c8665ae5.tar.gz
vein-689c34076d08e59b1382864f9efcd983c8665ae5.zip
added FashionMNIST
xd
Diffstat (limited to 'nneq.py')
-rw-r--r--nneq.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/nneq.py b/nneq.py
index 1549878..784002a 100644
--- a/nneq.py
+++ b/nneq.py
@@ -164,6 +164,9 @@ def inpla_export(model: onnx.ModelProto, bounds: Optional[Dict[str, List[float]]
interactions[in_name] = interactions[out_name]
yield from []
+ def op_reshape(node):
+ return op_flatten(node)
+
graph, initializers = model.graph, get_initializers(model.graph)
var_gen, wire_gen = NameGen("v"), NameGen("w")
interactions: Dict[str, List[List[str]]] = {}
@@ -172,6 +175,7 @@ def inpla_export(model: onnx.ModelProto, bounds: Optional[Dict[str, List[float]]
"Gemm": op_gemm,
"Relu": op_relu,
"Flatten": op_flatten,
+ "Reshape": op_reshape,
"MatMul": op_matmul
}
@@ -258,7 +262,7 @@ def z3_evaluate(model: str, X):
def net(model: onnx.ModelProto, X, bounds: Optional[Dict[str, List[float]]] = None):
model_hash = hashlib.sha256(model.SerializeToString()).hexdigest()
- bounds_key = tuple(sorted(bounds.items())) if bounds else None
+ bounds_key = tuple(sorted((k, tuple(v)) for k, v in bounds.items())) if bounds else None
cache_key = (model_hash, bounds_key)
if cache_key not in _INPLA_CACHE: