b3e879df49bc510fad94d6fe6c36e8b112c728c6,pytext/trainers/trainer.py,Trainer,test,#Trainer#Any#Any#Any#,54
Before Change
def test(self, test_iter, model, metric_reporter: MetricReporter):
model.eval()
return self._run_epoch(Stage.TEST, 1, test_iter, model, metric_reporter)
def train(
self,
train_iter: BatchIterator,
After Change
def test(self, test_iter, model, metric_reporter: MetricReporter):
model.eval()
with torch.no_grad():
test_metric = self._run_epoch(
Stage.TEST, 1, test_iter, model, metric_reporter
)
return test_metric
def train(
self,
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances
Project Name: facebookresearch/pytext
Commit Name: b3e879df49bc510fad94d6fe6c36e8b112c728c6
Time: 2019-01-15
Author: barlaso@fb.com
File Name: pytext/trainers/trainer.py
Class Name: Trainer
Method Name: test
Project Name: mlflow/mlflow
Commit Name: 20675f9f01e8c365999fee3ff1e4ec55ec5f8b57
Time: 2020-12-15
Author: 39497902+dbczumar@users.noreply.github.com
File Name: tests/onnx/test_onnx_model_export.py
Class Name:
Method Name: predicted
Project Name: cornellius-gp/gpytorch
Commit Name: 3c69f8a013450188cd7b5f90e141f0d8796862f4
Time: 2019-03-29
Author: gpleiss@gmail.com
File Name: gpytorch/functions/_inv_matmul.py
Class Name:
Method Name: _solve
Project Name: kengz/SLM-Lab
Commit Name: 2381a50a70559340a0335288d648b4bb9a675588
Time: 2018-06-12
Author: kengzwl@gmail.com
File Name: slm_lab/agent/algorithm/actor_critic.py
Class Name: ActorCritic
Method Name: train_critic