profiler
ValueError
– 如果state取值不在 [‘CPU’, ‘GPU’, ‘All’]中,或sorted_key取值不在 [None, ‘calls’, ‘total’, ‘max’, ‘min’, ‘ave’]中,则抛出异常。
#### sorted_key = 'total', 'calls', 'max', 'min', 'ave' 结果 ####
# 示例结果中,除了Sorted by number of xxx in descending order in the same thread 这句随着sorted_key变化而不同,其余均相同。
# 原因是,示例结果中,上述5列都已经按从大到小排列了。
-------------------------> Profiling Report <-------------------------
Place: CPU
Time unit: ms
Sorted by total time in descending order in the same thread
#Sorted by number of max in descending order in the same thread
#Sorted by number of min in descending order in the same thread
#Sorted by number of avg in descending order in the same thread
Event Calls Total Min. Max. Ave. Ratio.
thread0::conv2d 8 129.406 0.304303 127.076 16.1758 0.983319
thread0::elementwise_add 8 2.11865 0.193486 0.525592 0.264832 0.016099
thread0::feed 8 0.076649 0.006834 0.024616 0.00958112 0.000582432
#### sorted_key = None 结果 ####
-------------------------> Profiling Report <-------------------------
Place: CPU
Time unit: ms
Sorted by event first end time in descending order in the same thread
Event Calls Total Min. Max. Ave. Ratio.
thread0::feed 8 0.077419 0.006608 0.023349 0.00967738 0.00775934
thread0::conv2d 8 7.93456 0.291385 5.63342 0.99182 0.795243
thread0::elementwise_add 8 1.96555 0.191884 0.518004 0.245693 0.196998