此函數將元素添加到列表中函數
此函數獲取列表spa
此函數將元素相加並返回code
1 tf.add_to_collection('losses', regularizer(weights)) 2 tf.add_n(tf.get_collection('losses'))