def METHOD_NAME(self) -> Generator[None, None, None]:
    if "true" not in self.precision:
        yield
        return
    default_dtype = torch.get_default_dtype()
    torch.set_default_dtype(self._desired_dtype)
    yield
    torch.set_default_dtype(default_dtype)