Commit 9933e40d authored by Julien Girard-Satabin's avatar Julien Girard-Satabin
Browse files

finally fixed the minus bug, added more test files

parent 34bf020a
......@@ -25,7 +25,18 @@ let float_of_string_accurate f t=
| Float_Theory -> Printf.sprintf "((_ to_fp 11 53) RNE %.16f))" f
| Real_Theory | Linear_Real_Theory -> let q = Q.of_float f in
let num = Q.num q and denum = Q.den q in
"(/ "^(Z.to_string num)^" "^(Z.to_string denum)^"))"
let str_num =
if (Z.to_int num) < 0 then
"( - "^(List.nth (String.split_on_char '-' (Z.to_string num)) 1)^")"
else
Z.to_string num
and str_denum =
if (Z.to_int denum) < 0 then
"( - "^(List.nth (String.split_on_char '-' (Z.to_string denum)) 1)^")"
else
Z.to_string denum
in
"(/ "^str_num^" "^str_denum^"))"
(* List append tail recursive*)
let latr l1 l2 = List.rev_append (List.rev l1) l2
......
......@@ -12,13 +12,12 @@ let unpack x = match x with
| None -> (T.create [0;])
(* printf "%s" (Sys.getcwd ());; *)
let _ =
(* let input_file = "../../../test/onnx/test_simple.onnx" in *)
let input_file = Sys.argv.(1) in
let input_file = "../../../test/onnx/test_simple.onnx" in
(* let input_file = Sys.argv.(1) in *)
let model = Parser.parse_model_from_file input_file in
let graph = match model.Onnxpq.Model_proto.graph with
| Some g -> g
| None -> raise (Nograph "No graph in ONNX input file!") in
(* let nir_graph = Parser.node_graph graph in *)
let cfg = Parser.produce_cfg graph in
N.iter_vertex (fun x -> printf "%s\n" (T.show (unpack x.V.tensor))) cfg;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment