def forward(self, input): ang = self._backend.Linear.apply(F.normalize(input), F.normalize(self.weight)) ang = ang.clamp(-1, 1).acos() xnorm = input.norm(p=2, dim=1) return ang, xnorm