def _is_normal(self, tensor, mean, std):
if isinstance(tensor, Variable):
tensor = tensor.data
samples = list(tensor.view(-1))
p_value = stats.kstest(samples, 'norm', args=(mean, std)).pvalue
return p_value > 0.0001
评论列表
文章目录