Riccorl / transformers-embedder

Unnecessary use of comprehension PYL-R1721
Performance
Major
2 years ago2 years old
Unnecessary use of a comprehension, use listself.scalar_parameters instead.
73            return (tensor - mean) / torch.sqrt(variance + 1e-4)
74
75        normed_weights = torch.nn.functional.softmax(
76            torch.cat([parameter for parameter in self.scalar_parameters]), dim=077        )
78        normed_weights = torch.split(normed_weights, split_size_or_sections=1)
79