diff --git a/src/onnxruntime.cc b/src/onnxruntime.cc index c36cd0c..618bb45 100644 --- a/src/onnxruntime.cc +++ b/src/onnxruntime.cc @@ -1517,7 +1517,7 @@ ModelInstanceState::ValidateOutputs() if (model_state_->FindBatchOutput(io_name) == nullptr) { // if max_batch_size == 0 and is a scalar tensor all the // dimensions specified must be equal to 1 - if (model_state_->MaxBatchSize() > 0 && iit->second.dims_.size() > 0) { + if (model_state_->MaxBatchSize() > 0 || iit->second.dims_.size() > 0) { RETURN_IF_ERROR(CompareDimsSupported( model_state_->Name(), io_name, iit->second.dims_, dims, model_state_->MaxBatchSize(), true /* compare_exact */)); @@ -2362,7 +2362,7 @@ ModelInstanceState::ReadOutputTensors( // configuration. if (batchn_shape.size() == 0) { auto scalar_output_dims_it = scalar_outputs_.find(name); - if (scalar_output_dims_it != scalar_outputs_.end()) { + if (scalar_output_dims_it == scalar_outputs_.end()) { return TRITONSERVER_ErrorNew( TRITONSERVER_ERROR_INTERNAL, std::string(