Skip to content

Commit d9a6108

Browse files
authored
Add shape to FloatTensor probabilities (#600)
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 <[email protected]> Signed-off-by: Frederic DALENCON <[email protected]>
1 parent 868e23e commit d9a6108

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

onnxmltools/convert/lightgbm/_parse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def _parse_sklearn_classifier(scope, model, inputs, zipmap=True):
148148
SequenceType(DictionaryType(label_type, FloatTensorType())))
149149
else:
150150
output_probability = scope.declare_local_variable(
151-
'probabilities', FloatTensorType())
151+
'probabilities', FloatTensorType(shape=[None, len(classes)]))
152152
this_operator.outputs.append(output_label)
153153
this_operator.outputs.append(output_probability)
154154
return this_operator.outputs

0 commit comments

Comments
 (0)