message: [tf.data] Apply standard grappler optimizations after custom dataset optimizations
diff: @@ -224,6 +224,17 @@ class OptimizeDatasetOp : public UnaryDatasetOpKernel {
  // moment (e.g. because we have no cost model for dataset ops).
  if (optimizations_.empty()) {
  rewriter_config.add_optimizers("non-existent");
  + } else {
  + // If we apply custom dataset optimizers, explicitly trigger a subset of
  + // standard grappler optimizations to further optimize modified dataset
  + // graphs (e.g. performing constant folding on merged functions,
  + // removing unused graph nodes)
  + // TODO(b/118175421): This should be part of the tf.data optimization
  + // pass manager.
  + for (const auto& optimizer : {"pruning", "function", "constfold",
  + "shape", "arithmetic", "dependency"}) {
  + rewriter_config.add_optimizers(optimizer);
  + }
  }
  tensorflow::grappler::ItemConfig item_config;
  item_config.apply_optimizations = true;
  