Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Roshrini committed Jan 9, 2019
1 parent 3a907bc commit af3e70e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1698,17 +1698,14 @@ def convert_norm(node, **kwargs):
name, input_nodes, attrs = get_inputs(node, kwargs)

mx_axis = attrs.get("axis", None)
axes = convert_string_to_list(str(mx_axis)) if mx_axis is not None else None
axes = convert_string_to_list(str(mx_axis)) if mx_axis else None

keepdims = get_boolean_attribute_value(attrs, "keepdims")
ord = int(attrs.get("ord", 2))

if ord == 1:
onnx_op_name = "ReduceL1"
else:
onnx_op_name = "ReduceL2"
onnx_op_name = "ReduceL1" if ord == 1 else "ReduceL2"

if axes is not None:
if axes:
reduce_node = onnx.helper.make_node(
onnx_op_name,
input_nodes,
Expand Down
2 changes: 1 addition & 1 deletion python/mxnet/contrib/onnx/onnx2mx/_op_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,6 @@ def lpnormalization(attrs, inputs, proto_obj):
https://github.com/onnx/onnx/pull/1330"""
new_attrs = translation_utils._fix_attribute_names(attrs, {'p': 'ord'})
axis = int(attrs.get("axis", -1))
new_attrs.update(axis=axis)
new_attrs = translation_utils._add_extra_attributes(new_attrs, {'axis', axis})
return 'norm', new_attrs, inputs

0 comments on commit af3e70e

Please sign in to comment.