TensorFlow里,shape=(?, 120)里的问号是怎么回事呢
125 self.cos_sim (1024, 51) Tensor("cosine-imilarity-layer/mul_2:0", shape=(1024, 51), dtype=float32)
126 type(self.query_batch): <class 'tensorflow.python.framework.sparse_tensor.SparseTensor'>
127 type(self.doc_batch): <class 'tensorflow.python.framework.sparse_tensor.SparseTensor'>
128 weight_wh: <tf.Variable 'model-init/layer-wh-weight:0' shape=(4244, 400) dtype=float32_ref>
129 bias_wh: <tf.Variable 'model-init/layer-wh-bias:0' shape=(400,) dtype=float32_ref>
130 self.doc_act_fd: Tensor("fd-rotate/concat_49:0", shape=(?, 120), dtype=float32)
131 doc_y: Tensor("multi-layer/Elu_3:0", shape=(?, 120), dtype=float32)
132 query_y: Tensor("multi-layer/Elu_2:0", shape=(?, 120), dtype=float32)
133 query_norm: Tensor("cosine-imilarity-layer/Tile:0", shape=(?, 1), dtype=float32)
134 doc_norm: Tensor("cosine-imilarity-layer/Sqrt_1:0", shape=(?, 1), dtype=float32)
135 prod: Tensor("cosine-imilarity-layer/Sum_2:0", shape=(?, 1), dtype=float32)
136 norm_prod: Tensor("cosine-imilarity-layer/Mul_1:0", shape=(?, 1), dtype=float32)
137 cos_sim: Tensor("cosine-imilarity-layer/mul_2:0", shape=(1024, 51), dtype=float32)
138 softmax_prob: Tensor("loss/Softmax:0", shape=(1024, 51), dtype=float32)
139 hit_prob: Tensor("loss/Slice:0", shape=(1024, 1), dtype=float32)
它这个类自己定义的__str__,和Python语言本身语法没关系。
具体到tf里的意思是这个维度不规定,由它上下游op的维度推导出来。
【 在 legendjack 的大作中提到: 】
: 125 self.cos_sim (1024, 51) Tensor("cosine-imilarity-layer/mul_2:0", shape=(1024, 51), dtype=float32)
: 126 type(self.query_batch): <class 'tensorflow.python.framework.sparse_tensor.SparseTensor'>
: 127 type(self.doc_batch): <class 'tensorflow.python.framework.sparse_tensor.SparseTensor'>
: ...................
![uploading.4e448015.gif](https://csdnimg.cn/release/mp/img/uploading.4e448015.gif)
但是我都给他喂数据了,为啥还是?
【 在 ilovecpp 的大作中提到: 】
: 它这个类自己定义的__str__,和Python语言本身语法没关系。
: 具体到tf里的意思是这个维度不规定,由它上下游op的维度推导出来。