2021SC@SDUSC
一、分析的代码片段
1、代码展示
class NormStyleCode(nn.Module):
def forward(self, x):
"""Normalize the style codes. //规范化样式代码
Args:
x (Tensor): Style codes with shape (b, c).
Returns:
Tensor: Normalized tensor.
"""
return x * torch.rsqrt(torch.mean(x**2,