From 4c961ddf7de4d85b9e74c816eae79ae080ab6855 Mon Sep 17 00:00:00 2001 From: Animesh Jain Date: Thu, 6 Feb 2020 22:13:08 +0000 Subject: [PATCH] [Doc] ConvertLayout - Call RemoveUnunsedFunctions. --- docs/dev/convert_layout.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/dev/convert_layout.rst b/docs/dev/convert_layout.rst index 346b3fc..715d810 100644 --- a/docs/dev/convert_layout.rst +++ b/docs/dev/convert_layout.rst @@ -226,7 +226,11 @@ ConvertLayout pass is extremely easy to use. The pass is not a part of default r dtype_dict=dtype_dict) # Convert the layout to NCHW - mod = relay.transform.ConvertLayout('NCHW')(mod) + # RemoveUnunsedFunctions is used to clean up the graph. + seq = relay.transform.Sequential([relay.transform.RemoveUnusedFunctions(), + relay.transform.ConvertLayout('NCHW')]) + with relay.transform.PassContext(opt_level=3): + mod = seq(mod) # Call relay compilation with relay.build_config(opt_level=3): -- 2.7.4