我试图在一个语句中为多个变量赋值,但我不知道是否有一种很好的语法可以将它拆分为多行。
# This is the long version I don't want
a, b, c, d = tf.constant(1, name='constant_a'), tf.constant(2, name='constant_b'), tf.constant(3, name='constant_c'), tf.constant(4, name='constant_d')
# Does something like this exist?
a, b, c, d = tf.constant(1, name='constant_a'), /
tf.constant(2, name='constant_b'), /
tf.constant(3, name='constant_c'), /
tf.constant(4, name='constant_d')
有没有一种不错的 Pythonic 方式来做到这一点?
潇潇雨雨
aluckdog
largeQ
相关分类