7ce17a58e7b61b1bc2fc7384c1974e60967bd9fa,tests/models/test_visual_bert.py,TestVisualBertTorchscript,test_finetune_model,#TestVisualBertTorchscript#,89
Before Change
self.finetune_model.model.eval()
input_ids = torch.randint(low=0, high=30255, size=(1, 128)).long()
input_mask = torch.ones((1, 128)).long()
attention_mask = torch.ones((1, 228)).long()
token_type_ids = torch.zeros(1, 128).long()
visual_embeddings = torch.rand((1, 100, 2048)).float()
visual_embeddings_type = torch.zeros(1, 100).long()
After Change
@test_utils.skip_if_no_network
def test_finetune_model(self):
self.finetune_model.eval()
sample_list = SampleList()
sample_list.add_field(
"input_ids", torch.randint(low=0, high=30255, size=(1, 128)).long()
)
sample_list.add_field("input_mask", torch.ones((1, 128)).long())
sample_list.add_field("segment_ids", torch.zeros(1, 128).long())
sample_list.add_field("image_feature_0", torch.rand((1, 100, 2048)).float())
with torch.no_grad():
model_output = self.finetune_model(sample_list)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: facebookresearch/pythia
Commit Name: 7ce17a58e7b61b1bc2fc7384c1974e60967bd9fa
Time: 2020-10-13
Author: apsdehal@gmail.com
File Name: tests/models/test_visual_bert.py
Class Name: TestVisualBertTorchscript
Method Name: test_finetune_model
Project Name: facebookresearch/pythia
Commit Name: 7ce17a58e7b61b1bc2fc7384c1974e60967bd9fa
Time: 2020-10-13
Author: apsdehal@gmail.com
File Name: tests/models/test_visual_bert.py
Class Name: TestVisualBertTorchscript
Method Name: test_pretrained_model
Project Name: facebookresearch/pythia
Commit Name: 7ce17a58e7b61b1bc2fc7384c1974e60967bd9fa
Time: 2020-10-13
Author: apsdehal@gmail.com
File Name: tests/models/test_visual_bert.py
Class Name: TestVisualBertTorchscript
Method Name: test_finetune_model
Project Name: azavea/raster-vision
Commit Name: 9f31fde984bac09cfcaf03639f7e86eb09e1f5d1
Time: 2017-10-06
Author: lewfish@gmail.com
File Name: src/detection/rv/commands/predict_on_chips.py
Class Name:
Method Name: compute_prediction