layers.transpose限制name不起作用
Created by: dianhuasici
rnn = StaticRNN(name=scope)
layers.Print(input_embedding, message=scope + "/embedding", summarize=0)
embedding = layers.transpose(input_embedding, perm=[1, 0, 2], name=scope)
layers.Print(embedding, message=scope + "/embedding_transpose", summarize=0)
我调用了这段代码两次,输出结果如下:
1548057563 encode_fw/embedding Tensor[embedding_0.tmp_0]
shape: [128,30,300,]
dtype: f
data:
1548057563 encode_fw/embedding_transpose Tensor[encode_fw.tmp_0]
shape: [30,128,300,]
dtype: f
data:
1548057564 encode_bw/embedding Tensor[reverse_1.tmp_0]
shape: [128,30,300,]
dtype: f
data:
1548057564 encode_bw/embedding_transpose Tensor[encode_fw.tmp_0]
shape: [30,128,300,]
dtype: f
data:
可以看到第一次我输入进的scope为encode_fw,这时前两个输出的tensor的name都是对的,但是我第二次调用,transpose之后输出的name还是第一次的名字