此函数将元素添加到列表中函数
此函数获取列表spa
此函数将元素相加并返回code
1 tf.add_to_collection('losses', regularizer(weights)) 2 tf.add_n(tf.get_collection('losses'))