提交 58cd0ac8 authored 作者: carriepl's avatar carriepl

Merge pull request #3783 from nouiz/profilemode

Fix crash with mode=ProfileMode fix gh-3782
...@@ -596,7 +596,7 @@ class ProfileMode(Mode): ...@@ -596,7 +596,7 @@ class ProfileMode(Mode):
if not variable_shape: if not variable_shape:
print("\nProfile of Theano intermediate memory disabled. " print("\nProfile of Theano intermediate memory disabled. "
"To enable, set the Theano flag ProfileMode.profile_memory " "To enable, set the Theano flag ProfileMode.profile_memory "
"to True.""") "to True.")
else: else:
print(""" print("""
The memory profile in ProfileMode is removed! The memory profile in ProfileMode is removed!
...@@ -718,7 +718,7 @@ Test them first, as they are not guaranteed to always provide a speedup.""") ...@@ -718,7 +718,7 @@ Test them first, as they are not guaranteed to always provide a speedup.""")
if not printed_tip: if not printed_tip:
print(" Sorry, no tip for today.") print(" Sorry, no tip for today.")
def clone(self, link_kwargs=None, message=None): def clone(self, link_kwargs=None, optimizer="", message=None):
""" """
Create a new instance of this Mode. Create a new instance of this Mode.
...@@ -727,7 +727,9 @@ Test them first, as they are not guaranteed to always provide a speedup.""") ...@@ -727,7 +727,9 @@ Test them first, as they are not guaranteed to always provide a speedup.""")
""" """
new_linker = self.linker.clone(**link_kwargs) new_linker = self.linker.clone(**link_kwargs)
new_optimizer = self.provided_optimizer new_optimizer = optimizer
if optimizer == "":
new_optimizer = self.provided_optimizer
new_mode = type(self)(linker=new_linker, new_mode = type(self)(linker=new_linker,
optimizer=new_optimizer) optimizer=new_optimizer)
# If self is in the list or profiles to print, then add the # If self is in the list or profiles to print, then add the
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论