TensorFlow
yinheju
这个作者很懒,什么都没留下…
展开
-
tf.shape(tensor)和tensor.shape()的区别
#tf.shape(tensor)和tensor.shape()的区别a=tf.zeros([4,5,4,5,6])print(type(a.shape))print(a.shape.ndims)#多少个维度print(a.shape.as_list())#返回列表print(type(tf.shape(a)))print(type(tf.shape(a)[0]))b=a.shape...原创 2018-11-23 11:49:14 · 8030 阅读 · 0 评论 -
Transformer中张量的形状变化。
输入input_ids:[batch_size,seq_length]input_mask:[batch_size,seq_length]token_type_ids(segment_ids):[batch_size,seq_length]词向量嵌入:input_ids -> embedding_output:[batch_size,seq_length,embedding_...原创 2019-04-13 18:47:43 · 1203 阅读 · 0 评论