Bug: Benchmarks - remove fp16 samples type converting time for cnn and lstm models (#330)
**Description** Remove fp16 samples type converting time for cnn and lstm models.
This commit is contained in:
Родитель
ff51a3cee9
Коммит
6e74918044
|
@ -134,8 +134,8 @@ class PytorchCNN(PytorchBase):
|
|||
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)
|
||||
|
|
|
@ -141,8 +141,8 @@ class PytorchLSTM(PytorchBase):
|
|||
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()
|
||||
|
|
Загрузка…
Ссылка в новой задаче