Fix pass pipeline

PiperOrigin-RevId: 292257393
Change-Id: I15cc854f2bc8c87d48107d5bd2128be41aaa7986
This commit is contained in:
Yuanzhong Xu 2020-01-29 18:04:53 -08:00 committed by TensorFlower Gardener
parent cb2eeb76ba
commit 4ca8bf54d7

View File

@ -29,11 +29,12 @@ namespace TFTPU {
void CreateTPUBridge(OpPassManager &pm) {
// Run island coarsening before shape inference to allow more exact shape
// inference using constant folding within islands.
OpPassManager &func_pm = pm.nest<FuncOp>();
func_pm.addPass(tf_executor::CreateTFExecutorIslandCoarseningPass());
pm.nest<FuncOp>().addPass(
tf_executor::CreateTFExecutorIslandCoarseningPass());
// Run shape inference so that tf_executor/tf_device ops created later will
// likely to inherit more concrete types.
pm.addPass(TF::CreateTFShapeInferencePass());
OpPassManager &func_pm = pm.nest<FuncOp>();
func_pm.addPass(CreateTPUClusterFormationPass());
func_pm.addPass(createCanonicalizerPass());
// Place DecomposeResourceOpsPass before TFExecutorConstantSinking pass