Unverified Commit c5aa4f4e authored by user4543's avatar user4543 Committed by GitHub
Browse files

Bug: Benchmarks - remove fp16 samples type converting time (#332)

**Description**
Remove fp16 samples type converting time for training cnn and lstm inference.
parent a9634ef5
......@@ -101,8 +101,8 @@ def _train_step(self, precision):
curr_step = 0
while True:
for idx, sample in enumerate(self._dataloader):
start = time.time()
sample = sample.to(dtype=getattr(torch, precision.value))
start = time.time()
if self._gpu_available:
sample = sample.cuda()
self._optimizer.zero_grad()
......
......@@ -174,8 +174,8 @@ def _inference_step(self, precision):
self._model.eval()
while True:
for idx, sample in enumerate(self._dataloader):
start = time.time()
sample = sample.to(dtype=getattr(torch, precision.value))
start = time.time()
if self._gpu_available:
sample = sample.cuda()
self._model(sample)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment