x = [[2.]]
m = tf.matmul(x, x)
print("hello, {}".format(m))
输出
hello, [[4.]]
hello 后面的{}指代format()括号里的东西
还可指定位置
"{1} {0} {1}".format("hello", "world") # 设置指定位置
'world hello world'
x = [[2.]]
m = tf.matmul(x, x)
print("hello, {}".format(m))
输出
hello, [[4.]]
hello 后面的{}指代format()括号里的东西
还可指定位置
"{1} {0} {1}".format("hello", "world") # 设置指定位置
'world hello world'