연구/Python
-
Line Profiler - Profile python code execution time (example)연구/Python 2020. 9. 9. 14:28
주로 사용하는 Python profiler인 Line Profiler를 Example과 함께 간단히 소개합니다. Line profiler 설치 pip install line_profiler Example code : conv2d, batchnorm2d, relu 로 이루어진 간단한 network를 만들었습니다. import torch import torch.nn as nn @profile def convmodel(netwrok, input, iter): for i in range (iter): out = network.conv2d(input) out = network.bn(out) out = network.relu(out) return out if __name__ == '__main__': input =..