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

Commit

Permalink
Add op name in error
Browse files Browse the repository at this point in the history
  • Loading branch information
vandanavk committed Dec 26, 2018
1 parent 83499a9 commit 689d57e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/mxnet/contrib/onnx/mx2onnx/_op_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ def convert_l2normalization(node, **kwargs):
mode = attrs.get("mode", "instance")

if mode != "channel":
raise AttributeError("ONNX currently supports channel mode only")
raise AttributeError("L2Normalization: ONNX currently supports channel mode only")

l2norm_node = onnx.helper.make_node(
"LpNormalization",
Expand Down Expand Up @@ -1302,7 +1302,7 @@ def convert_reshape(node, **kwargs):

for val in output_shape_list:
if val in not_supported_shape:
raise AttributeError("Shape value not supported in ONNX", val)
raise AttributeError("Reshape: Shape value not supported in ONNX", val)

reshape_node = onnx.helper.make_node(
"Reshape",
Expand Down Expand Up @@ -1428,7 +1428,7 @@ def convert_squeeze(node, **kwargs):

axis = attrs.get("axis", None)
if not axis:
raise AttributeError("Missing axis attribute: ONNX currently requires axis to "
raise AttributeError("Squeeze: Missing axis attribute: ONNX currently requires axis to "
"be specified for squeeze operator")
axis = convert_string_to_list(axis)

Expand Down Expand Up @@ -1679,7 +1679,7 @@ def convert_logsoftmax(node, **kwargs):
axis = int(attrs.get("axis", -1))
temp = attrs.get("temperature", 'None')
if temp != 'None':
raise AttributeError("ONNX supports only temperature=None")
raise AttributeError("LogSoftMax: ONNX supports only temperature=None")

node = onnx.helper.make_node(
'LogSoftmax',
Expand Down

0 comments on commit 689d57e

Please sign in to comment.