From ec85081f3e509b11e7f42de69a0556e6e6decc5b Mon Sep 17 00:00:00 2001 From: rensilin Date: Mon, 19 Aug 2019 14:57:09 +0800 Subject: [PATCH] fix Change-Id: I69ec0b9d21b37aa5a9671c343b8927948bc14735 --- .../feed/scripts/create_programs.py | 46 +++++++++---------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/paddle/fluid/train/custom_trainer/feed/scripts/create_programs.py b/paddle/fluid/train/custom_trainer/feed/scripts/create_programs.py index 9c154b90..3c014683 100644 --- a/paddle/fluid/train/custom_trainer/feed/scripts/create_programs.py +++ b/paddle/fluid/train/custom_trainer/feed/scripts/create_programs.py @@ -19,6 +19,27 @@ class ModelBuilder: """ Attributes: _save_path: Save path of programs + + def _inference(): + Build inference network(without loss and optimizer) + **This function is declared in the network_desc_path file, and will be set in initialize()** + + Returns: + list: inputs + and + list: outputs + pass + + def _loss_function(outputs): + **This function is declared in the network_desc_path file, and will be set in initialize()** + Args: + outputs: the second result of inference() + + Returns: + Variable: loss + and + list: labels + pass """ def initialize(self, network_desc_path, save_path=None): @@ -68,31 +89,6 @@ class ModelBuilder: return True - def _inference(): - """Build inference network(without loss and optimizer) - **This function is declared in the network_desc_path file, and will be set in initialize()** - - Returns: - list: inputs - and - list: outputs - """ - pass - - def _loss_function(outputs): - """ - **This function is declared in the network_desc_path file, and will be set in initialize()** - - Args: - outputs: the second result of inference() - - Returns: - Variable: loss - and - list: labels - """ - pass - def build_and_save(self): """Build programs and save to _save_path """ -- GitLab