Repository: PaddlePaddle/Paddle2ONNX

Issue:
Need add CI for the repo



Discussion:

Resolving patch:
diff --git a/convert.py b/convert.py
--- a/convert.py
+++ b/convert.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
+# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -30,14 +30,16 @@ def convert(dirname):
     inference_scope = fluid.core.Scope()
     with fluid.scope_guard(inference_scope):
         [inference_program, feed_target_names,
-            fetch_targets] = fluid.io.load_inference_model(dirname, exe)
+         fetch_targets] = fluid.io.load_inference_model(dirname, exe)
 
         # Using blocks in programs, create nodes using:
         onnx_nodes = []
         all_inputs = []
         for block in inference_program.blocks:
-            all_inputs += [paddle_variable_to_onnx_tensor(
-                v, block) for v in block.vars if v not in ['feed', 'fetch']]
+            all_inputs += [
+                paddle_variable_to_onnx_tensor(v, block) for v in block.vars
+                if v not in ['feed', 'fetch']
+            ]
 
             for op in block.ops:
                 if op.type in ops.PADDLE_TO_ONNX:
@@ -45,8 +47,8 @@ def convert(dirname):
                     # TODO(varunarora): Use the modifier function to make the
                     # transformation.
                     node_proto = helper.make_node(
-                        ops.PADDLE_TO_ONNX[op.type][0],
-                        op.input_arg_names, op.output_arg_names)
+                        ops.PADDLE_TO_ONNX[op.type][0], op.input_arg_names,
+                        op.output_arg_names)
 
                     onnx_nodes.append(node_proto)
                 else:
@@ -59,8 +61,9 @@ def convert(dirname):
         # Nodes, name of graph, inputs, outputs.
         if dirname[-1] == '/':
             dirname = dirname[:-1]
-        graph = helper.make_graph(onnx_nodes, os.path.basename(
-            dirname).split('.')[0], all_inputs, [])
+        graph = helper.make_graph(onnx_nodes,
+                                  os.path.basename(dirname).split('.')[0],
+                                  all_inputs, [])
 
         print graph
 
@@ -70,7 +73,7 @@ def convert(dirname):
 if __name__ == "__main__":
     # Read arguments: path to model.
     parser = argparse.ArgumentParser()
-    parser.add_argument("--modeldir", required=True,
-        help="Input PaddlePaddle model")
+    parser.add_argument(
+        "--modeldir", required=True, help="Input PaddlePaddle model")
     args = parser.parse_args()
     convert(args.modeldir)
diff --git a/ops.py b/ops.py
--- a/ops.py
+++ b/ops.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
+# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -11,7 +11,6 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-
 """
 Priority of ops (uniques) to figure out support for.
 
@@ -460,7 +459,6 @@ def xor_op():
     # 'Ceil', NEEDS ATTENTION.
     'cast': ('Clip', clip_op),
     'concat': ('Concat', concat_op),
-
     ',': ('Constant', constant_op),
     'conv': ('Conv', conv_op),
 
diff --git a/variables.py b/variables.py
--- a/variables.py
+++ b/variables.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved.
+# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
 from onnx import helper, onnx_pb2, TensorProto
 import paddle.fluid.core as core
 
+
 def paddle_variable_to_onnx_tensor(paddle_var_name, block):
     # TODO(varunarora): Need to do this only in the case of VarType.LOD_TENSOR.
     paddle_var = block.var(paddle_var_name)
@@ -36,5 +37,5 @@ def paddle_variable_to_onnx_tensor(paddle_var_name, block):
     # '': onnx_pb2.TensorProto.STRING,
     # '': onnx_pb2.TensorProto.COMPLEX64,
     # '': onnx_pb2.TensorProto.COMPLEX128,
-    core.VarDesc.VarType.BOOL: onnx_pb2.TensorProto.BOOL,
+    core.VarDesc.VarType.BOOL: onnx_pb2.TensorProto.BOOL
 }


Test patch: