MCPcopy Index your code
hub / github.com/OpenGVLab/InternVL / speed_test

Function speed_test

classification/export.py:43–55  ·  view source on GitHub ↗
(model, input)

Source from the content-addressed store, hash-verified

41
42
43def speed_test(model, input):
44 # warm-up
45 for _ in tqdm(range(100)):
46 _ = model(input)
47
48 # speed test
49 torch.cuda.synchronize()
50 start = time.time()
51 for _ in tqdm(range(100)):
52 _ = model(input)
53 end = time.time()
54 th = 100 / (end - start)
55 print(f'using time: {end - start}, throughput {th}')
56
57
58def torch2onnx(args, cfg):

Callers 1

checkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected