onnxruntime/test/ir/graph_test.cc
TEST(TypeInferenceTest, VariadicOutput) {
  std::vector<NodeArg*> inputs;
  std::vector<NodeArg*> outputs;
  TypeProto tensor_type;
  tensor_type.mutable_tensor_type()->set_elem_type(TensorProto_DataType_FLOAT);
  Model model("graph_1");
  auto& graph = model.MainGraph();
  auto& X = graph.GetOrCreateNodeArg("X", &tensor_type);
  inputs.push_back(&X);
  auto& Y = graph.GetOrCreateNodeArg("Y", nullptr);
  outputs.push_back(&Y);
  auto& Z = graph.GetOrCreateNodeArg("Z", nullptr);
  outputs.push_back(&Z);
  graph.AddNode("node_1", "Split", "node 1.", inputs, outputs);
  auto status = graph.Resolve();
  EXPECT_TRUE(status.IsOK()) << status.ErrorMessage();
  CheckTensorEltType(Y.TypeAsProto(), TensorProto_DataType_FLOAT);
  CheckTensorEltType(Z.TypeAsProto(), TensorProto_DataType_FLOAT);
}
// Test that output type can be inferred for ops with variadic outputs
Test that output type can be inferred for ops with variadic outputs
Test that output type can be inferred for ops with variadic outputs
TEST(TypeInferenceTest, VariadicOutput) {
  std::vector<NodeArg*> inputs;
  std::vector<NodeArg*> outputs;
  TypeProto tensor_type;
  tensor_type.mutable_tensor_type()->set_elem_type(TensorProto_DataType_FLOAT);
  Model model("graph_1");
  auto& graph = model.MainGraph();
  auto& X = graph.GetOrCreateNodeArg("X", &tensor_type);
  inputs.push_back(&X);
  auto& Y = graph.GetOrCreateNodeArg("Y", nullptr);
  outputs.push_back(&Y);
  auto& Z = graph.GetOrCreateNodeArg("Z", nullptr);
  outputs.push_back(&Z);
  graph.AddNode("node_1", "Split", "node 1.", inputs, outputs);
  auto status = graph.Resolve();
  EXPECT_TRUE(status.IsOK()) << status.ErrorMessage();
  CheckTensorEltType(Y.TypeAsProto(), TensorProto_DataType_FLOAT);
  CheckTensorEltType(Z.TypeAsProto(), TensorProto_DataType_FLOAT);
}
TEST ( TypeInferenceTest , VariadicOutput ) { std :: vector < NodeArg * > inputs ; std :: vector < NodeArg * > outputs ; TypeProto tensor_type ; tensor_type . mutable_tensor_type ( ) -> set_elem_type ( TensorProto_DataType_FLOAT ) ; Model model ( " " ) ; auto & graph = model . MainGraph ( ) ; auto & X = graph . GetOrCreateNodeArg ( " " , & tensor_type ) ; inputs . push_back ( & X ) ; auto & Y = graph . GetOrCreateNodeArg ( " " , nullptr ) ; outputs . push_back ( & Y ) ; auto & Z = graph . GetOrCreateNodeArg ( " " , nullptr ) ; outputs . push_back ( & Z ) ; graph . AddNode ( " " , " " , " " , inputs , outputs ) ; auto status = graph . Resolve ( ) ; EXPECT_TRUE ( status . IsOK ( ) ) << status . ErrorMessage ( ) ; CheckTensorEltType ( Y . TypeAsProto ( ) , TensorProto_DataType_FLOAT ) ; CheckTensorEltType ( Z . TypeAsProto ( ) , TensorProto_DataType_FLOAT ) ; }
Test that output type can be inferred for ops with variadic outputs
Test that output type can be inferred for ops with variadic outputs