Skip to content

Commit

Permalink
コメントの方法を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Masato Hori committed Feb 1, 2018
1 parent 4621366 commit 33dd4c5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python/test/utils/test_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def onnx_value_info_proto_to_variable(info, network):
}

def convert_to_function(node):
'''Convert given node to corresponding function'''
"""Convert given node to corresponding function"""
func = nnabla_pb2.Function()
func.name = node.name
func.type = onnx_optype_to_nnabla_function_type.get(node.op_type, node.op_type)
Expand Down Expand Up @@ -423,7 +423,7 @@ def nnp_model_to_onnx_graph(graph, nnp):
# Add all the constant parameters for all nodes
# and the first node's input as input
def create_dim(d):
'''Createa dimension message for a given dimension'''
"""Createa dimension message for a given dimension"""
dim = TensorShapeProto.Dimension()
dim.dim_value = d
return dim
Expand Down Expand Up @@ -473,7 +473,7 @@ def export(self, file_path):


def run_executor(nn_net, exec_name):
'''Run specified executor and return its network'''
"""Run specified executor and return its network"""
exe = nn_net.executors[exec_name]
exe.network.forward(exe.forward_sequence)
return exe.network
Expand All @@ -482,7 +482,7 @@ def run_executor(nn_net, exec_name):
def convert_onnx_to_nnp_and_compare(
tmpdir, onnx_dir, onnx_name, nnp_name, out_name, exec_name,
compare_values=True, show_onnx=False, show_nnp=False, show_output=False):
'''Convert specified ONNX to NNP and compare each results ran by Caffe2 and NNabla'''
"""Convert specified ONNX to NNP and compare each results ran by Caffe2 and NNabla"""
path = os.path.join(onnx_dir, onnx_name)
# Process onnx with caffe2 backend
model = onnx.load(path)
Expand Down Expand Up @@ -521,7 +521,7 @@ def convert_onnx_to_nnp_and_compare(
def convert_nnp_to_onnx_and_compare(
tmpdir, nnp_dir, nnp_name, onnx_name, out_name, exec_name,
compare_values=True, show_nnp=False, show_onnx=False, show_output=False):
'''Convert specified NNP to ONNX and compare each results ran by Caffe2 and NNabla'''
"""Convert specified NNP to ONNX and compare each results ran by Caffe2 and NNabla"""
# Process nnp with nnabla
path = os.path.join(nnp_dir, nnp_name)
nn_net = nnload.load([path])
Expand Down Expand Up @@ -619,7 +619,7 @@ def test_onnx_nnp_conversion_conv(tmpdir, nnp_fixture):

def test_nnp_onnx_conversion_conv(tmpdir, nnp_fixture):
convert_nnp_to_onnx_and_compare(
tmpdir, TEST_DATA_DIR, "conv.nnp", "conv.onnx", "out_data_1", "exec_0", show_onnx=True)
tmpdir, TEST_DATA_DIR, "conv.nnp", "conv.onnx", "out_data_1", "exec_0")

#def test_onnx_nnp_conversion_softmax(tmpdir):
# path = os.path.join(TEST_DATA_DIR, "softmax.onnx")
Expand Down

0 comments on commit 33dd4c5

Please sign in to comment.