MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / MeasureTime

Class MeasureTime

demo/Tacotron2/inference.py:165–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163
164
165class MeasureTime():
166 def __init__(self, measurements, key, cpu_run=False):
167 self.measurements = measurements
168 self.key = key
169 self.cpu_run = cpu_run
170
171 def __enter__(self):
172 if not self.cpu_run:
173 torch.cuda.synchronize()
174 self.t0 = time.perf_counter()
175
176 def __exit__(self, exc_type, exc_value, exc_traceback):
177 if not self.cpu_run:
178 torch.cuda.synchronize()
179 self.measurements[self.key] = time.perf_counter() - self.t0
180
181
182def main():

Callers 8

mainFunction · 0.90
mainFunction · 0.90
infer_tacotron2_trtFunction · 0.90
infer_waveglow_trtFunction · 0.90
infer_waveglow_onnxFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.85

Calls

no outgoing calls

Tested by 2

mainFunction · 0.72
mainFunction · 0.72