Skip to content

Commit

Permalink
Add shape to FloatTensor probabilities (#600)
Browse files Browse the repository at this point in the history
When zipmap is set to false, onnx checker complains about
'probabilities' tensor that do not have a shape. This commit adds
correct shape for this case.

Signed-off-by: Frederic DALENCON <frederic.dalencon@softathome.com>

Signed-off-by: Frederic DALENCON <frederic.dalencon@softathome.com>
  • Loading branch information
frdasah authored Jan 9, 2023
1 parent 868e23e commit d9a6108
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion onnxmltools/convert/lightgbm/_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def _parse_sklearn_classifier(scope, model, inputs, zipmap=True):
SequenceType(DictionaryType(label_type, FloatTensorType())))
else:
output_probability = scope.declare_local_variable(
'probabilities', FloatTensorType())
'probabilities', FloatTensorType(shape=[None, len(classes)]))
this_operator.outputs.append(output_label)
this_operator.outputs.append(output_probability)
return this_operator.outputs
Expand Down

0 comments on commit d9a6108

Please sign in to comment.