[Perf] Avoid more GPU<->CPU syncs on the model execution path (#51738)
Signed-off-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
@@ -270,8 +270,7 @@ class Phi4MMImageEncoder(nn.Module):
|
||||
pixel_values = pixel_values.flatten(0, 1)
|
||||
|
||||
img_features = self.get_img_features(
|
||||
pixel_values,
|
||||
image_attention_mask.type(torch.BoolTensor).flatten(0, 1).to(target_device),
|
||||
pixel_values, image_attention_mask.bool().flatten(0, 1)
|
||||
)
|
||||
|
||||
base_feat_height_target = self.base_feat_height_target
|
||||
|
||||
Reference in New Issue
Block a user