KL散度,也叫做相对熵,计算公式如下: import torch.nn as nnimport torchimport torch.nn.functional as Fif __name__ == '__main__'