(coords_norm: torch.Tensor, pe_gaussian: torch.Tensor)
| 148 | |
| 149 | |
| 150 | def position_encode(coords_norm: torch.Tensor, pe_gaussian: torch.Tensor) -> torch.Tensor: |
| 151 | coords = 2.0 * coords_norm - 1.0 |
| 152 | enc = coords @ pe_gaussian |
| 153 | enc = 2.0 * math.pi * enc |
| 154 | return torch.cat([torch.sin(enc), torch.cos(enc)], dim=-1) |
| 155 | |
| 156 | |
| 157 | def build_prompt_encoder_outputs(weights: Dict[str, torch.Tensor], case: PromptCase): |
no outgoing calls
no test coverage detected