Skip to content
Snippets Groups Projects
Commit 82bf1910 authored by Michele Alberti's avatar Michele Alberti
Browse files

Merge branch 'fix/julien/more-onnx-ops' into 'master'

Add more ONNX operators to NIER

Closes #21 and #22

See merge request laiser/caisar!50
parents 08b6c863 31aa8b4d
No related branches found
No related tags found
No related merge requests found
...@@ -125,30 +125,42 @@ module Node = struct ...@@ -125,30 +125,42 @@ module Node = struct
type operator = type operator =
| Add | Add
| Sub
| Mul | Mul
| Div
| Matmul | Matmul
| Gemm
| LogSoftmax | LogSoftmax
| ReLu | ReLu
| Transpose | Transpose
| Squeeze | Squeeze
| MaxPool | MaxPool
| Conv | Conv
| Reshape
| Flatten
| Identity | Identity
| Constant
| NO_OP | NO_OP
| RW_Linearized_ReLu | RW_Linearized_ReLu
let str_op o = let str_op o =
match o with match o with
| Add -> "Add" | Add -> "Add"
| Sub -> "Sub"
| Mul -> "Mul" | Mul -> "Mul"
| Div -> "Div"
| Matmul -> "Matmul" | Matmul -> "Matmul"
| Gemm -> "Gemm"
| LogSoftmax -> "LogSoftmax" | LogSoftmax -> "LogSoftmax"
| ReLu -> "ReLu" | ReLu -> "ReLu"
| Transpose -> "Transpose" | Transpose -> "Transpose"
| Squeeze -> "Squeeze" | Squeeze -> "Squeeze"
| MaxPool -> "MaxPool" | MaxPool -> "MaxPool"
| Conv -> "Conv" | Conv -> "Conv"
| Reshape -> "Reshape"
| Flatten -> "Flatten"
| Identity -> "Identity" | Identity -> "Identity"
| Constant -> "Constant"
| NO_OP -> "NO_OP" | NO_OP -> "NO_OP"
| RW_Linearized_ReLu -> "RW_Linearized_ReLu" | RW_Linearized_ReLu -> "RW_Linearized_ReLu"
......
...@@ -80,15 +80,21 @@ module Node : sig ...@@ -80,15 +80,21 @@ module Node : sig
type operator = type operator =
| Add | Add
| Sub
| Mul | Mul
| Div
| Matmul | Matmul
| Gemm
| LogSoftmax | LogSoftmax
| ReLu | ReLu
| Transpose | Transpose
| Squeeze | Squeeze
| MaxPool | MaxPool
| Conv | Conv
| Reshape
| Flatten
| Identity | Identity
| Constant
| NO_OP | NO_OP
| RW_Linearized_ReLu | RW_Linearized_ReLu
......
...@@ -110,14 +110,20 @@ let produce_cfg (g : Oproto.Onnx.GraphProto.t) = ...@@ -110,14 +110,20 @@ let produce_cfg (g : Oproto.Onnx.GraphProto.t) =
| Some o -> ( | Some o -> (
match o with match o with
| "Add" -> NCFG.Node.Add | "Add" -> NCFG.Node.Add
| "Sub" -> NCFG.Node.Sub
| "Mul" -> NCFG.Node.Mul | "Mul" -> NCFG.Node.Mul
| "Div" -> NCFG.Node.Div
| "Relu" -> NCFG.Node.ReLu | "Relu" -> NCFG.Node.ReLu
| "MatMul" -> NCFG.Node.Matmul | "MatMul" -> NCFG.Node.Matmul
| "Gemm" -> NCFG.Node.Gemm
| "LogSoftmax" -> NCFG.Node.LogSoftmax | "LogSoftmax" -> NCFG.Node.LogSoftmax
| "Transpose" -> NCFG.Node.Transpose | "Transpose" -> NCFG.Node.Transpose
| "Squeeze" -> NCFG.Node.Squeeze | "Squeeze" -> NCFG.Node.Squeeze
| "MaxPool" -> NCFG.Node.MaxPool | "MaxPool" -> NCFG.Node.MaxPool
| "Constant" -> NCFG.Node.Constant
| "Conv" -> NCFG.Node.Conv | "Conv" -> NCFG.Node.Conv
| "Reshape" -> NCFG.Node.Reshape
| "Flatten" -> NCFG.Node.Flatten
| "Identity" -> NCFG.Node.Identity | "Identity" -> NCFG.Node.Identity
| _ -> raise (ParseError ("Unsupported ONNX operator " ^ o))) | _ -> raise (ParseError ("Unsupported ONNX operator " ^ o)))
in in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment