(self, x: torch.Tensor)
| 659 | raise ValueError("Invalid set gradient checkpointing") |
| 660 | |
| 661 | def _encode(self, x: torch.Tensor) -> torch.Tensor: |
| 662 | x = [ |
| 663 | self.model.encode(u.unsqueeze(0), self.scale).squeeze(0) |
| 664 | for u in x |
| 665 | ] |
| 666 | x = torch.stack(x) |
| 667 | return x |
| 668 | |
| 669 | @apply_forward_hook |
| 670 | def encode( |