(
self,
rotation: Optional[Rotation],
translation: Optional[torch.Tensor],
)
| 183 | class Frame: |
| 184 | |
| 185 | def __init__( |
| 186 | self, |
| 187 | rotation: Optional[Rotation], |
| 188 | translation: Optional[torch.Tensor], |
| 189 | ): |
| 190 | if rotation is None and translation is None: |
| 191 | rotation = Rotation.identity((0, )) |
| 192 | translation = zero_translation((0, )) |
| 193 | elif translation is None: |
| 194 | translation = zero_translation(rotation.shape, rotation.dtype, |
| 195 | rotation.device, |
| 196 | rotation.requires_grad) |
| 197 | |
| 198 | elif rotation is None: |
| 199 | rotation = Rotation.identity( |
| 200 | translation.shape[:-1], |
| 201 | translation.dtype, |
| 202 | translation.device, |
| 203 | translation.requires_grad, |
| 204 | ) |
| 205 | |
| 206 | if (rotation.shape != translation.shape[:-1]) or (rotation.device |
| 207 | != # noqa W504 |
| 208 | translation.device): |
| 209 | raise ValueError('RotationMatrix and translation incompatible') |
| 210 | |
| 211 | self._r = rotation |
| 212 | self._t = translation |
| 213 | |
| 214 | @staticmethod |
| 215 | def identity( |
nothing calls this directly
no test coverage detected