Change assert on a null value to an ort_enforce (#9982)

This commit is contained in:
Ryan Hill 2021-12-09 14:44:58 -08:00 committed by GitHub
parent b9909f985e
commit e0960d7d79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -199,7 +199,7 @@ static void TestOptimizerGraphBuilderWithInitialStates(OptimizerGraphConfig conf
const ONNX_NAMESPACE::TensorProto* tensor{};
for (auto& weight_item : opt_initializer_names_map) {
for (auto& opt_item : weight_item.second) {
ASSERT_TRUE(graph.GetInitializedTensor(opt_item.second, tensor));
ORT_ENFORCE(graph.GetInitializedTensor(opt_item.second, tensor));
ASSERT_TRUE(tensor->data_type() == ONNX_NAMESPACE::TensorProto::FLOAT || tensor->data_type() == ONNX_NAMESPACE::TensorProto::INT64);
if (tensor->data_type() == ONNX_NAMESPACE::TensorProto::FLOAT) {
VerifyTensorValue(tensor, values[0]);