Skip to content

Commit

Permalink
Merge branch 'dev' into 8185-tests-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
garciadias committed Dec 4, 2024
2 parents 6e9c66e + fa5c75c commit dda65c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions monai/networks/blocks/pos_embed_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def build_sincos_position_embedding(
grid_h = torch.arange(h, dtype=torch.float32)
grid_w = torch.arange(w, dtype=torch.float32)

grid_h, grid_w = torch.meshgrid(grid_h, grid_w, indexing="ij")
grid_h, grid_w = torch.meshgrid(grid_h, grid_w)

if embed_dim % 4 != 0:
raise AssertionError("Embed dimension must be divisible by 4 for 2D sin-cos position embedding")
Expand All @@ -75,7 +75,7 @@ def build_sincos_position_embedding(
grid_w = torch.arange(w, dtype=torch.float32)
grid_d = torch.arange(d, dtype=torch.float32)

grid_h, grid_w, grid_d = torch.meshgrid(grid_h, grid_w, grid_d, indexing="ij")
grid_h, grid_w, grid_d = torch.meshgrid(grid_h, grid_w, grid_d)

if embed_dim % 6 != 0:
raise AssertionError("Embed dimension must be divisible by 6 for 3D sin-cos position embedding")
Expand Down

0 comments on commit dda65c4

Please sign in to comment.