提交 70d574cc authored 作者: nouiz's avatar nouiz

Merge pull request #508 from delallea/minor

Minor stuff
...@@ -776,7 +776,7 @@ compile GotoBLAS2 (ATLAS may work too, but was not tested, and is ...@@ -776,7 +776,7 @@ compile GotoBLAS2 (ATLAS may work too, but was not tested, and is
usually reported to be slower and more difficult to compile -- especially usually reported to be slower and more difficult to compile -- especially
on Windows). on Windows).
GotoBLAS2 can be downloaded GotoBLAS2 can be downloaded
`here <http://www.tacc.utexas.edu/tacc-projects/gotoblas2/downloads>`__ `here <http://www.tacc.utexas.edu/tacc-projects/gotoblas2>`__
(we tested v1.13). (we tested v1.13).
To compile it, you will also need MSYS and Perl (installation steps are To compile it, you will also need MSYS and Perl (installation steps are
described below). described below).
......
...@@ -46,7 +46,7 @@ def _atexit_print_fn(): ...@@ -46,7 +46,7 @@ def _atexit_print_fn():
if len(_atexit_print_list) > 1: if len(_atexit_print_list) > 1:
# Make a global profile # Make a global profile
cum = copy.copy(_atexit_print_list[0]) cum = copy.copy(_atexit_print_list[0])
cum.message = "Sum of all Theano function" cum.message = "Sum of all Theano functions"
for ps in _atexit_print_list[1:]: for ps in _atexit_print_list[1:]:
for attr in ["compile_time", "fct_call_time", "fct_callcount", for attr in ["compile_time", "fct_call_time", "fct_callcount",
"vm_call_time", "optimizer_time", "linker_time"]: "vm_call_time", "optimizer_time", "linker_time"]:
...@@ -375,7 +375,7 @@ class ProfileStats(object): ...@@ -375,7 +375,7 @@ class ProfileStats(object):
local_time, 100*local_time / self.fct_call_time) local_time, 100*local_time / self.fct_call_time)
print >> file, ' Total compile time: %es' % self.compile_time print >> file, ' Total compile time: %es' % self.compile_time
print >> file, ' Theano Optimizer time: %es' % self.optimizer_time print >> file, ' Theano Optimizer time: %es' % self.optimizer_time
print >> file, ' Theano Linker time(include c, cuda code generation/compiling): %es' % self.linker_time print >> file, ' Theano Linker time (includes C, CUDA code generation/compiling): %es' % self.linker_time
print >> file, '' print >> file, ''
...@@ -724,13 +724,13 @@ if 0: # old code still to be ported from ProfileMode ...@@ -724,13 +724,13 @@ if 0: # old code still to be ported from ProfileMode
class ScanProfileStats(ProfileStats): class ScanProfileStats(ProfileStats):
callcount = 0.0 callcount = 0.0
nbsteps = 0.0 nbsteps = 0.0
call_time = 0.0 call_time = 0.0
def __init__(self, atexit_print = True, name = None, **kwargs):
def __init__(self, atexit_print=True, name=None, **kwargs):
super(ScanProfileStats, self).__init__(atexit_print, **kwargs) super(ScanProfileStats, self).__init__(atexit_print, **kwargs)
self.name = name self.name = name
def summary_function(self, file): def summary_function(self, file):
# RP: everytime we compile a function a ProfileStats is created for # RP: everytime we compile a function a ProfileStats is created for
# that function. This means that everytime a optimization replaces # that function. This means that everytime a optimization replaces
...@@ -748,20 +748,20 @@ class ScanProfileStats(ProfileStats): ...@@ -748,20 +748,20 @@ class ScanProfileStats(ProfileStats):
else: else:
print >> file, 'Scan Op profiling' print >> file, 'Scan Op profiling'
print >> file, '==================' print >> file, '=================='
print >> file, ' Message: %s'%self.message print >> file, ' Message: %s' % self.message
print >> file, ' Time in %i calls of the op (for a total of %i steps) %es' % ( print >> file, (' Time in %i calls of the op (for a total of %i '
self.callcount, self.nbsteps, self.call_time) 'steps) %es' %
(self.callcount, self.nbsteps, self.call_time))
print >> file, '' print >> file, ''
val = 0 val = 0
if self.call_time > 0: if self.call_time > 0:
val = self.vm_call_time*100/self.call_time val = self.vm_call_time * 100 / self.call_time
print >> file, ' Total time spent in calling the VM %es (%.3f%%)'%( print >> file, ' Total time spent in calling the VM %es (%.3f%%)' % (
self.vm_call_time, val) self.vm_call_time, val)
val = 100 val = 100
if self.call_time > 0: if self.call_time > 0:
val = 100.-self.vm_call_time*100/self.call_time val = 100. - self.vm_call_time * 100 / self.call_time
print >> file, ' Total overhead (computing slices ..) %es (%.3f%%)'%( print >> file, ' Total overhead (computing slices..) %es (%.3f%%)' % (
self.call_time - self.vm_call_time, val) self.call_time - self.vm_call_time, val)
print >> file, '' print >> file, ''
...@@ -145,12 +145,12 @@ class SharedVariable(Variable): ...@@ -145,12 +145,12 @@ class SharedVariable(Variable):
def _value_get(self): def _value_get(self):
raise Exception("sharedvar.value does not exist anymore. Use " raise Exception("sharedvar.value does not exist anymore. Use "
"sharedvar.get_value() or sharedvar.get_value()" "sharedvar.get_value() or sharedvar.set_value()"
" instead.") " instead.")
def _value_set(self, new_value): def _value_set(self, new_value):
raise Exception("sharedvar.value does not exist anymore. Use " raise Exception("sharedvar.value does not exist anymore. Use "
"sharedvar.get_value() or sharedvar.get_value()" "sharedvar.get_value() or sharedvar.set_value()"
" instead.") " instead.")
# We keep this just to raise an error # We keep this just to raise an error
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论