Fix cache miss handling for coordinate retrieval (#24145)

Signed-off-by: LJ <4545060+ausk@users.noreply.github.com>
This commit is contained in:
LJ 2026-04-07 12:47:49 +08:00 committed by GitHub
parent 36560f2a38
commit 3d7bb126c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -330,7 +330,7 @@ class TransformerDecoder(nn.Module):
# cache miss, will create compilation issue
# In case we're not compiling, we'll still rely on the dict-based cache
if feat_size not in self.coord_cache:
self.coord_cache[feat_size] = self._get_coords(H, W, reference_boxes.device)
self.coord_cache[feat_size] = self._get_coords(H, W, reference_boxes.device, reference_boxes.dtype)
coords_h, coords_w = self.coord_cache[feat_size]
assert coords_h.shape == (H,)