tensorflow/core/grappler/optimizers/data/auto_shard_test.cc
// Adds a MapDataset, a RebatchDataset, a PrefetchDataset and a fake sink that
// are common to all graphs; and sets the fetch node to the fake sink.
Adds a MapDataset, a RebatchDataset, a PrefetchDataset and a fake sink that
are common to all graphs; and sets the fetch node to the fake sink.
Adds a MapDataset a RebatchDataset a PrefetchDataset and a fake sink that are common to all graphs ; and sets the fetch node to the fake sink .
void FinishItem(GrapplerItem* item, const string& input_node_name) {
  *item->graph.add_node() =
      NDef("map_before_rebatch", "MapDataset", {input_node_name},
           {{"f", "__inference_Dataset_map_normalize_8232"},
            {"output_shapes", gtl::ArraySlice<TensorShape>{}},
            {"output_types", gtl::ArraySlice<DataType>{}}});
  *item->graph.add_node() =
      NDef("num_replicas", "Const", {}, {{"value", 2}, {"dtype", DT_INT32}});
  *item->graph.add_node() =
      NDef("rebatch", "RebatchDataset", {"map_before_rebatch", "num_replicas"},
           {{"output_shapes", gtl::ArraySlice<TensorShape>{}},
            {"output_types", gtl::ArraySlice<DataType>{}}});
  *item->graph.add_node() =
      NDef("prefetch_count", "Const", {}, {{"value", 2}, {"dtype", DT_INT32}});
  *item->graph.add_node() =
      NDef("prefetch", "PrefetchDataset", {"rebatch", "prefetch_count"},
           {{"output_shapes", gtl::ArraySlice<TensorShape>{}},
            {"output_types", gtl::ArraySlice<DataType>{}}});
  *item->graph.add_node() = NDef("Sink", "Identity", {"prefetch"}, {});
  item->fetch.push_back("Sink");
}
void FinishItem ( GrapplerItem * item , const string & input_node_name ) { * item -> graph . add_node ( ) = NDef ( " " , " " , { input_node_name } , { { " " , " " } , { " " , gtl :: ArraySlice < TensorShape > { } } , { " " , gtl :: ArraySlice < DataType > { } } } ) ; * item -> graph . add_node ( ) = NDef ( " " , " " , { } , { { " " , 2 } , { " " , DT_INT32 } } ) ; * item -> graph . add_node ( ) = NDef ( " " , " " , { " " , " " } , { { " " , gtl :: ArraySlice < TensorShape > { } } , { " " , gtl :: ArraySlice < DataType > { } } } ) ; * item -> graph . add_node ( ) = NDef ( " " , " " , { } , { { " " , 2 } , { " " , DT_INT32 } } ) ; * item -> graph . add_node ( ) = NDef ( " " , " " , { " " , " " } , { { " " , gtl :: ArraySlice < TensorShape > { } } , { " " , gtl :: ArraySlice < DataType > { } } } ) ; * item -> graph . add_node ( ) = NDef ( " " , " " , { " " } , { } ) ; item -> fetch . push_back ( " " ) ; }
Adds a MapDataset, a RebatchDataset, a PrefetchDataset and a fake sink that
are common to all graphs; and sets the fetch node to the fake sink.
Adds a MapDataset a RebatchDataset a PrefetchDataset and a fake sink that are common to all graphs ; and sets the fetch node to the fake sink .