def _init_new_prototypes(self, targets: Tensor):
        """Initialize prototypes for previously unseen classes.
        :param targets: The targets Tensor to make prototypes for.
        """
        y_unique: Tensor = torch.unique(targets).squeeze().view(-1)
        for idx in range(y_unique.size(0)):
            c: int = y_unique[idx].item()
            if c not in self.p_mem:  # Init new prototype
                self.p_mem[c] = (
                    normalize(
                        torch.empty((1, self.p_size)).uniform_(-1, 1),
                        p=2,
                        dim=1,
                    )
                    .detach()
                    .to(targets.device)
                )
Initialize prototypes for previously unseen classes.
        :param targets: The targets Tensor to make prototypes for.
        
avalanche/training/plugins/cope.py