onnxruntime/test/ir/graph_test.cc
TEST(TypeInferenceTest, TypeAttribute) {
  std::vector<NodeArg*> inputs;
  std::vector<NodeArg*> outputs;
  Model model("graph_1");
  auto& graph = model.MainGraph();
  auto& output_arg = graph.GetOrCreateNodeArg("node_1_out_1", nullptr);
  outputs.push_back(&output_arg);
  auto& node_1 = graph.AddNode("node_1", "RandomNormal", "node 1.", inputs, outputs);
  AddAttribute(node_1, "dtype", TensorProto_DataType_FLOAT);
  AddAttribute(node_1, "shape", {2, 3});
  auto status = graph.Resolve();
  EXPECT_TRUE(status.IsOK()) << status.ErrorMessage();
}
// Test that output type can be inferred for ops with a type-attribute
Test that output type can be inferred for ops with a type-attribute
Test that output type can be inferred for ops with a type - attribute
TEST(TypeInferenceTest, TypeAttribute) {
  std::vector<NodeArg*> inputs;
  std::vector<NodeArg*> outputs;
  Model model("graph_1");
  auto& graph = model.MainGraph();
  auto& output_arg = graph.GetOrCreateNodeArg("node_1_out_1", nullptr);
  outputs.push_back(&output_arg);
  auto& node_1 = graph.AddNode("node_1", "RandomNormal", "node 1.", inputs, outputs);
  AddAttribute(node_1, "dtype", TensorProto_DataType_FLOAT);
  AddAttribute(node_1, "shape", {2, 3});
  auto status = graph.Resolve();
  EXPECT_TRUE(status.IsOK()) << status.ErrorMessage();
}
TEST ( TypeInferenceTest , TypeAttribute ) { std :: vector < NodeArg * > inputs ; std :: vector < NodeArg * > outputs ; Model model ( " " ) ; auto & graph = model . MainGraph ( ) ; auto & output_arg = graph . GetOrCreateNodeArg ( " " , nullptr ) ; outputs . push_back ( & output_arg ) ; auto & node_1 = graph . AddNode ( " " , " " , " " , inputs , outputs ) ; AddAttribute ( node_1 , " " , TensorProto_DataType_FLOAT ) ; AddAttribute ( node_1 , " " , { 2 , 3 } ) ; auto status = graph . Resolve ( ) ; EXPECT_TRUE ( status . IsOK ( ) ) << status . ErrorMessage ( ) ; }
Test that output type can be inferred for ops with a type-attribute
Test that output type can be inferred for ops with a type - attribute