提交 b5dd215d 编写于 作者: H Helin Wang

improve comments

上级 392a9dd9
......@@ -17,10 +17,12 @@ __all__ = ['Inferencer', ]
class Inferencer(object):
def __init__(self, network_func, params, place=None):
# we need to generate a framework.Program by calling
# network_func reference: fluid.program_guard in test_word2vec.py
# move the default_main_program to self.program
# and run the default_startup program
# 1. we need to generate a framework.Program by calling
# network_func. Reference: fluid.program_guard in test_word2vec.py
# 2. move the default_main_program to self.program.
# 3. run the default_startup program.
self.params = params
self.place = place
......
......@@ -32,10 +32,16 @@ class Event(object):
class Trainer(object):
def __init__(self, network_func, optimizer, params=None, place=None):
# we need to generate a framework.Program by calling
# network_func reference: fluid.program_guard in test_word2vec.py
# move the default_main_program to self.program
# and run the default_startup program on an empty
# 1. we need to generate a framework.Program by calling
# network_func. Reference: fluid.program_guard in
# test_word2vec.py
# 2. move the default_main_program to self.program and run the
# default_startup program on an empty core.Scope()
# 3. call self.params.add_vars with the initialized scope, it
# will add the new vars of the initialized scope into
# self.params.
self.network_func = network_func
self.optimizer = optimizer
self.params = params
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册