def build(self, input_shape):
input_shape = tf.TensorShape(input_shape)
if input_shape[-1].value is None:
raise ValueError("Input to DotProductLayer must have the last dimension defined")
if input_shape[-1].value != self._depth_size:
self._space_transform = self.add_variable('kernel',
shape=(input_shape[-1].value, self._depth_size),
dtype=self.dtype,
trainable=True)
else:
self._space_transform = None
seq2seq_helpers.py 文件源码
python
阅读 32
收藏 0
点赞 0
评论 0
评论列表
文章目录