Unverified Commit 2d956958 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Use `math.pi` instead of `torch.pi` in `MaskFormer` (#19201)



* Use math.pi
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent 34be08ef
...@@ -2102,7 +2102,7 @@ class MaskFormerSinePositionEmbedding(nn.Module): ...@@ -2102,7 +2102,7 @@ class MaskFormerSinePositionEmbedding(nn.Module):
self.num_pos_feats = num_pos_feats self.num_pos_feats = num_pos_feats
self.temperature = temperature self.temperature = temperature
self.normalize = normalize self.normalize = normalize
self.scale = 2 * torch.pi if scale is None else scale self.scale = 2 * math.pi if scale is None else scale
def forward(self, x: Tensor, mask: Optional[Tensor] = None) -> Tensor: def forward(self, x: Tensor, mask: Optional[Tensor] = None) -> Tensor:
if mask is None: if mask is None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment