提交 2f0c2b0b authored 作者: Razvan Pascanu's avatar Razvan Pascanu

Make the code use the new profile mechanism

上级 8c69d0c8
...@@ -667,15 +667,25 @@ class Scan(Op): ...@@ -667,15 +667,25 @@ class Scan(Op):
# and this little string helps us to find this spot: # and this little string helps us to find this spot:
# "PROFILE_CODE" # "PROFILE_CODE"
if hasattr(self.fn.maker.mode,'fct_call_time'): if hasattr(self.fn.maker, 'profile') and self.fn.maker.profile:
self.fn.maker.mode.fct_call_time[self.fn] += t_fn profile = self.fn.maker.profile
self.fn.maker.mode.fct_call[self.fn] += n_steps profile.callcount += 1
profile.nbsteps += n_steps
self.fn.maker.mode.call_time += t_fn profile.call_time += t_call
self.fn.maker.mode.fn_time += t_fn profile.vm_call_time += t_fn
if hasattr(self.fn.fn, 'update_profile'):
self.fn.fn.update_profile(profile)
#/* Old ProfileMode
#if hasattr(self.fn.maker.mode,'fct_call_time'):
# self.fn.maker.mode.fct_call_time[self.fn] += t_fn
# self.fn.maker.mode.fct_call[self.fn] += n_steps
#self.fn.maker.mode.call_time += t_fn
#self.fn.maker.mode.fn_time += t_fn
# Old Profile Mode */
self.t_call = t_call self.t_call = t_call
self.t_fn = t_fn self.t_fn = t_fn
### Infer Shape ### Infer Shape
def infer_shape(self, node, input_shapes): def infer_shape(self, node, input_shapes):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论