Skip to content

Commit f4295f1

Browse files
committed
Update run.py
1 parent 1d3ab83 commit f4295f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

run.py

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import argparse
44
import torch
55
import torch.nn as nn
6+
import time
67
import math
78
from torch.autograd import Variable
89
from PIL import Image
@@ -46,7 +47,10 @@
4647
if opt.cuda:
4748
input = input.cuda()
4849

50+
start_time = time.time()
4951
out = model(input)
52+
elapsed_time = time.time() - start_time
53+
print("===> It takes {:.4f} seconds.".format(elapsed_time))
5054
out = out.cpu()
5155

5256
print("type = ", type(out))

0 commit comments

Comments
 (0)