Skip to content

Commit

Permalink
Fix compile error when ninja not available and custon kernel activated
Browse files Browse the repository at this point in the history
  • Loading branch information
yonigozlan committed Sep 18, 2024
1 parent 2f07ac2 commit 8fe3ec5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/transformers/models/rt_detr/modeling_rt_detr.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,8 @@ def forward(
else:
raise ValueError(f"Last dim of reference_points must be 2 or 4, but got {reference_points.shape[-1]}")

if self.disable_custom_kernels:
# Ignore copy
if self.disable_custom_kernels or MultiScaleDeformableAttention is None:
# PyTorch implementation
output = multi_scale_deformable_attention(
value, spatial_shapes_list, sampling_locations, attention_weights
Expand Down

0 comments on commit 8fe3ec5

Please sign in to comment.