37f58cc580da8735ae5a259d4cb4ba0b8701e78e,tests/test_pytorch_data_teacher.py,TestPytorchDataTeacher,test_pyt_preprocess,#TestPytorchDataTeacher#,88
Before Change
return act, agent
return agent.observe(act), agent
print("Testing test_pyt_preprocess action equivalent to observation")
ff = io.StringIO()
with redirect_stdout(ff):
defaults = parser_defaults.copy()
defaults["batch_size"] = 1
After Change
return act, agent
return agent.observe(act), agent
with testing_utils.capture_output() as _, testing_utils.tempdir() as tmpdir:
defaults = parser_defaults.copy()
defaults["batch_size"] = 1
defaults["datatype"] = "train:stream:ordered"
// Get processed act from agent
defaults["model_file"] = os.path.join(tmpdir, "model")
defaults["dict_file"] = os.path.join(tmpdir, "model.dict")
agent_processed_observation, agent1 = get_teacher_act(defaults)
// Get preprocessed act from teacher
defaults["model_file"] = os.path.join(tmpdir, "model")
defaults["dict_file"] = os.path.join(tmpdir, "model.dict")
defaults["pytorch_preprocess"] = True
teacher_processed_act, agent2 = get_teacher_act(defaults, teacher_processed=True) // noqa: E501
for key in agent_processed_observation:
val1 = agent_processed_observation[key]
val2 = teacher_processed_act[key]
if isinstance(val1, torch.Tensor):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: facebookresearch/ParlAI
Commit Name: 37f58cc580da8735ae5a259d4cb4ba0b8701e78e
Time: 2019-02-08
Author: roller@fb.com
File Name: tests/test_pytorch_data_teacher.py
Class Name: TestPytorchDataTeacher
Method Name: test_pyt_preprocess
Project Name: mortendahl/tf-encrypted
Commit Name: 7272af90d4f5916f61f8bc5660e5605e730bbd78
Time: 2019-07-16
Author: suriyaku@gmail.com
File Name: examples/securenn/network_a.py
Class Name:
Method Name:
Project Name: facebookresearch/ParlAI
Commit Name: 37f58cc580da8735ae5a259d4cb4ba0b8701e78e
Time: 2019-02-08
Author: roller@fb.com
File Name: tests/test_pytorch_data_teacher.py
Class Name: TestPytorchDataTeacher
Method Name: test_valid_pyt_batchsort