、私はtensorflowのWebサイトから、次のコードを拾いました。私の理解によると、axis = 0は行、axis = 1は列です。reduce_sum()はテンソルフローでどのように機能しますか?私はtensorflowを勉強
はどのように彼らは、コメントに記載された出力を得ていますか?私は##に対する私の考えに従って出力を述べました。
import tensorflow as tf
x = tf.constant([[1, 1, 1], [1, 1, 1]])
tf.reduce_sum(x, 0) # [2, 2, 2] ## [3, 3]
tf.reduce_sum(x, 1) # [3, 3] ##[2, 2, 2]
tf.reduce_sum(x, [0, 1]) # 6 ## Didn't understood at all.
numpyと反対ですか? –
@BhaskarDhariyalそれは同じです。私は私の答えを更新しました。 – Maxim