def METHOD_NAME(self, images: Tensor, theta: Tensor) -> Tensor:
    """
    images: BxYxX
    theta: Q, in radians
    """
    images = images.expand(len(theta), *images.shape)  # QxBxYxX
    cos = torch.cos(theta)
    sin = torch.sin(theta)
    rot = torch.stack([cos, sin, -sin, cos], 1).view(-1, 2, 2)
    grid = self.coords[:, 0:2] / self.extent @ rot  # grid between -1 and 1
    grid = grid.view(len(rot), self.D, self.D, 2)  # QxYxXx2
    offset = self.center - grid[:, self.D2, self.D2]  # Qx2
    grid += offset[:, None, None, :]
    rotated = F.grid_sample(images, grid)  # QxBxYxX
    return rotated.transpose(0, 1)  # BxQxYxX