I ran code like this
import pdb
import time
import torch

x = torch.rand([30,30])
x = x.cuda()
y = torch.rand([30,1])
y = y.cuda()

# warmup
w = torch.gesv(y,x)

start = time.time()
w = torch.gesv(y,x)
end = time.time()

print "do once gesv:"
print end-start

start = time.time()
for i in range(100):
  w = torch.gesv(y,x)
end = time.time()

print "do hundrad gesv:"
print end-start

# warmup
w = torch.add(y,x)

start = time.time()
w = torch.add(y,x)
end = time.time()

print "do once add:"
print end-start

start = time.time()
for i in range(100):
  w = torch.add(y,x)
end = time.time()

print "do hundrad add:"
print end-start

we can find that the time of ‘do ten gesv’ is about ten times as much as ‘do once gesv’, however the time of “do once add” and “do ten add” almost the same, Why is that?