欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

對tensorflow 中tile函數(shù)的使用詳解

 更新時間:2020年02月07日 11:35:07   作者:ML_BOY  
今天小編就為大家分享一篇對tensorflow 中tile函數(shù)的使用詳解,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧

tensorflow中tile是用來復(fù)制tensor的指定維度,具體看下面的代碼:

import tensorflow as tf
 
a = tf.constant([[1, 2], [3, 4], [5, 6]], dtype=tf.float32)
 
a1 = tf.tile(a, [2, 2])
with tf.Session() as sess:
  print(sess.run(a1))

結(jié)果就是:

[[ 1. 2. 1. 2.]
 [ 3. 4. 3. 4.]
 [ 5. 6. 5. 6.]
 [ 1. 2. 1. 2.]
 [ 3. 4. 3. 4.]

 [ 5. 6. 5. 6.]]

因?yàn)?/strong>

a1 = tf.tile(a, [2, 2]) 表示把a(bǔ)的第一個維度復(fù)制兩次,第二個維度復(fù)制2次。

以上這篇對tensorflow 中tile函數(shù)的使用詳解就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論