Skip to content

Commit

Permalink
Fix error messages when OnnxInferenceModel output is not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
juliabeliaeva committed Dec 1, 2022
1 parent 12caccd commit ee899bf
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ public object OrtSessionResultConversions {
method: String,
type: OnnxJavaType
) {
require(valueInfo !is MapInfo) { "Output $valueName is a Map, but currently method $method supports only $type Tensor outputs." }
require(valueInfo !is SequenceInfo) { "Output '$valueName' is a Sequence, but currently method $method supports $type float Tensor outputs." }
require(valueInfo is TensorInfo && valueInfo.type == type) { "Currently method $method supports only $type Tensor outputs, but output '$valueName' is not a float Tensor." }
require(valueInfo !is MapInfo) { "Output '$valueName' is a Map, but currently method '$method' supports only $type Tensor outputs." }
require(valueInfo !is SequenceInfo) { "Output '$valueName' is a Sequence, but currently method '$method' supports $type Tensor outputs." }
require(valueInfo is TensorInfo && valueInfo.type == type) { "Currently method '$method' supports only $type Tensor outputs, but output '$valueName' is not a $type Tensor." }
}
}

0 comments on commit ee899bf

Please sign in to comment.