-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove main_program
and startup_program
as the paramter of layer function
#6655
Changes from all commits
7ab0b9b
d8c1dca
90cdcff
595eb6e
cfe68e8
66a9c29
ce50883
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,19 +21,11 @@ def name(self): | |
|
||
@property | ||
def main_program(self): | ||
prog = self.kwargs.get('main_program', None) | ||
if prog is None: | ||
return default_main_program() | ||
else: | ||
return prog | ||
return default_main_program() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As we can change the default program, I think it's improper to keep calling it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe just |
||
|
||
@property | ||
def startup_program(self): | ||
prog = self.kwargs.get('startup_program', None) | ||
if prog is None: | ||
return default_startup_program() | ||
else: | ||
return prog | ||
return default_startup_program() | ||
|
||
def append_op(self, *args, **kwargs): | ||
return self.main_program.current_block().append_op(*args, **kwargs) | ||
|
@@ -151,13 +143,6 @@ def set_variable_initializer(self, var, initializer): | |
persistable=True, | ||
initializer=initializer) | ||
|
||
@property | ||
def to_kwargs(self): | ||
return { | ||
'main_program': self.main_program, | ||
'startup_program': self.startup_program | ||
} | ||
|
||
def append_bias_op(self, input_var, dim_start=1, dim_end=None): | ||
""" | ||
Append bias operator and return its output. If the user does not set | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The line 153:
kwargs = {'main_program': main_program}
should also be removed. I can not comment on unchanged line so I leave it here.