
tensorflow
iSikai
这个作者很懒,什么都没留下…
展开
-
深度理解tf.gather和tf.gather_nd的用法
tf.gather和tf.gather_nd都是从tensor中取出index标注的部分,不同之处在于,gather一般只使用一个index来标注,而gather_nd可以使用多个index。例如:如何直观理解gather_nd的indices呢?在上例中,直观的理解就是,取出params中位于[0,0]和[1,1]处的tensor,放入index中对应的位置。换句话说,除去tenso...原创 2020-02-28 17:15:55 · 13665 阅读 · 1 评论 -
Tensorflow调试指南:tf.Print
TL;DRtf.Print(input,data)a=tf.Print(a,["value",a,"shape",tf.shape(a)])tensor a可以定义在代码的任意一个位置,只要在session.run时节点a有数据流过(否则你也不会想要debug它),data就会被打印到终端。Codeimport tensorflow as tfdef _test_(): w...原创 2020-02-28 11:39:39 · 1009 阅读 · 0 评论