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

Function evaluating

demo/Tacotron2/train.py:250–258  ·  view source on GitHub ↗

Temporarily switch to evaluation mode.

(model)

Source from the content-addressed store, hash-verified

248
249@contextmanager
250def evaluating(model):
251 '''Temporarily switch to evaluation mode.'''
252 istrain = model.training
253 try:
254 model.eval()
255 yield model
256 finally:
257 if istrain:
258 model.train()
259
260
261def validate(model, criterion, valset, epoch, batch_iter, batch_size,

Callers 1

validateFunction · 0.85

Calls 1

trainMethod · 0.80

Tested by

no test coverage detected