(self, x: torch.Tensor, y: torch.Tensor)
| 28 | self.lin.load_state_dict(get_state_dict(net_type, version)) |
| 29 | |
| 30 | def forward(self, x: torch.Tensor, y: torch.Tensor): |
| 31 | feat_x, feat_y = self.net(x), self.net(y) |
| 32 | |
| 33 | diff = [(fx - fy) ** 2 for fx, fy in zip(feat_x, feat_y)] |
| 34 | res = [l(d).mean((2, 3), True) for d, l in zip(diff, self.lin)] |
| 35 | |
| 36 | return torch.sum(torch.cat(res, 0), 0, True) |
nothing calls this directly
no outgoing calls
no test coverage detected