tensor和numpy
使用tf.*定义的都是tensor,包括variable和placeholder以及tf.constant与tf的operator操作也是返回tensor
numpy转tensor
使用tf.convert_to_tensor可将一个numpy转为tensor
tensor转numpy
由sess.run或者eval返回的任何张量都是numpy数组
tensor和numpy具有相同的shape,表示为tuple()
转载自链接:https://www.jianshu.com/p/74012acd72fa
最后
以上就是秀丽机器猫最近收集整理的关于(1)tf中tensor和numpy的全部内容,更多相关(1)tf中tensor和numpy内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复