diff --git a/lib/nnet/nnet.ml b/lib/nnet/nnet.ml index 42a3fdcc70220386c6e1e0fc1fc175e777ef4fb4..997190142668dfad58873cba656099c8bfe459b0 100644 --- a/lib/nnet/nnet.ml +++ b/lib/nnet/nnet.ml @@ -101,14 +101,15 @@ let to_nir weights_biases n_inputs layer_sizes = let biases_tensor = Nir.Gentensor.of_float_array (Array.of_list biases) in let biases_node = Node.create (Node.Constant { data = biases_tensor }) in let add_node = - Node.create (Add { input1 = matmul_node; input2 = biases_node }) + Node.create (Add { input1 = biases_node; input2 = matmul_node }) in let relu_node = Node.create (Node.ReLu { input = add_node }) in relu_node in let in_sh = Shape.of_list [ n_inputs ] in let g = - Nir.Ngraph.create (traverse_wb (aggregated_wb weights_biases layer_sizes) in_sh) + Nir.Ngraph.create + (traverse_wb (aggregated_wb weights_biases layer_sizes) in_sh) in g diff --git a/tests/nir_to_onnx.t b/tests/nir_to_onnx.t index 8963344445a4784d8ec86117029ae4be33a06891..6eab31a9d053fde60da04a0a56520ca73479071a 100644 --- a/tests/nir_to_onnx.t +++ b/tests/nir_to_onnx.t @@ -25,7 +25,7 @@ Test verify Input name should be 0 - $ python3 bin/inspect_onnx.py + $ python3 bin/inspect_onnx.py out/nn_onnx.nir.onnx out/nn_onnx.nir.onnx has 1 input nodes {'name': '0', 'type': {'tensorType': {'elemType': 1, 'shape': {'dim': [{'dimValue': '1'}, {'dimValue': '1'}, {'dimValue': '1'}, {'dimValue': '3'}]}}}} 1 files checked @@ -51,7 +51,7 @@ Input name should be 0 Input name should be 0 - $ python3 bin/inspect_onnx.py - out/nn_onnx.nir.onnx has 1 input nodes - {'name': '0', 'type': {'tensorType': {'elemType': 1, 'shape': {'dim': [{'dimValue': '1'}, {'dimValue': '1'}, {'dimValue': '1'}, {'dimValue': '3'}]}}}} + $ python3 bin/inspect_onnx.py out_nnet/nn_nnet.nir.onnx + out_nnet/nn_nnet.nir.onnx has 1 input nodes + {'name': '0', 'type': {'tensorType': {'elemType': 1, 'shape': {'dim': [{'dimValue': '5'}]}}}} 1 files checked