tf.nn.l2_loss() 函数原型: tf.nn.l2_loss(t, name=None) 作用: 计算张量t的L2范数,但是没有开方并而是除2,具体如下: L2=12∗∑i=1nti2L_2=\frac{1}{2}*\sum_{i=1}^{n}t_i^2L2=21∗i=1∑nti2