tensorflow/core/grappler/optimizers/data/noop_elimination_test.cc
// This test checks whether the no-op elimination correctly handles
// transformations at the end of the pipeline.
This test checks whether the no-op elimination correctly handles
transformations at the end of the pipeline.
This test checks whether the no - op elimination correctly handles transformations at the end of the pipeline .
TEST_P(NoOpLastEliminationTest, EliminateLastNoOpNode) {
  GrapplerItem item;
  MutableGraphView graph(&item.graph);
  const string &node_type = std::get<0>(GetParam());
  const std::vector<int> node_params = std::get<1>(GetParam());
  const bool should_keep_node = std::get<2>(GetParam());
  NodeDef *range_node = MakeRangeNode(&graph);
  NodeDef *node = MakeNode(node_type, node_params, range_node->name(), &graph);
  NoOpElimination optimizer;
  GraphDef output;
  TF_ASSERT_OK(optimizer.Optimize(nullptr, item, &output));
  EXPECT_EQ(graph_utils::ContainsGraphNodeWithName(node->name(), output),
            should_keep_node);
}
TEST_P ( NoOpLastEliminationTest , EliminateLastNoOpNode ) { GrapplerItem item ; MutableGraphView graph ( & item . graph ) ; const string & node_type = std :: get < 0 > ( GetParam ( ) ) ; const std :: vector < int > node_params = std :: get < 1 > ( GetParam ( ) ) ; const bool should_keep_node = std :: get < 2 > ( GetParam ( ) ) ; NodeDef * range_node = MakeRangeNode ( & graph ) ; NodeDef * node = MakeNode ( node_type , node_params , range_node -> name ( ) , & graph ) ; NoOpElimination optimizer ; GraphDef output ; TF_ASSERT_OK ( optimizer . Optimize ( nullptr , item , & output ) ) ; EXPECT_EQ ( graph_utils :: ContainsGraphNodeWithName ( node -> name ( ) , output ) , should_keep_node ) ; }
This test checks whether the no-op elimination correctly handles
transformations at the end of the pipeline.
This test checks whether the no - op elimination correctly handles transformations at the end of the pipeline .