TensorFlow operator overloading

前端 未结 2 843
温柔的废话
温柔的废话 2020-11-29 06:16

What is the difference between

   tf.add(x, y)

and

   x + y

in TensorFlow? What would be different in y

2条回答
  •  遥遥无期
    2020-11-29 06:56

    Mrry nicely explained that there is no real difference. I will just add when using tf.add is beneficial.

    tf.add has one important parameter which is name. It allows you to name the operation in a graph which will be visible in tensorboard. So my rule of thumb, if it will be beneficial to name an operation in tensorboard, I use tf. equivalent, otherwise I go for brevity and use overloaded version.

提交回复
热议问题