# timing is stored by node, we compute timing by Op on demand
rval={}
returnrval#TODO: continue here
returnrval# TODO: continue here
fornode,countinself.apply_callcount.items():
rval.setdefault(node.op,0)
rval[node.op]+=1
returnrval
fora,tinop_time.items():
ifhasattr(a,'flops'):
op_flops[a]=a.flops*op_call[a]/t/1e6
fora,tinself.op_time.items():
ifhasattr(a,'flops'):
op_flops[a]=a.flops*op_call[a]/t/1e6
flops_msg=''
flops_msg=''
ifop_flops:
flops_msg=' <MFlops/s>'
print'\nHACK WARNING: we print the flops for some OP, but the logic don\' always work. You need to know the internal of Theano to make it work correctly. Otherwise don\'t use!'
print'\nOp-wise summary: <%% of local_time spent on this kind of Op> <cumulative %%> <self seconds> <cumulative seconds> <time per call> %s <nb_call> <nb apply> <Op name>'%(flops_msg)
flops_msg=' <MFlops/s>'
print('\nHACK WARNING: we print the flops for some OP, but the'
' logic don\' always work. You need to know the internal'
print' Theano Op time (included in fct call, Time spent running thunks) %.3fs %.1f%%(of total) %.1f%%(of fct call)'%(local_time,local_time/total_time*100,time_pr_in_fct)