def testNoMemorySlotsLeft(self):
# Every example must have at least one unmasked memory slot for attention
# to work.
memory_mask = tf.convert_to_tensor(
[
[True, True, True, True],
[True, True, True, False],
[False, False, False, False],
],
dtype=tf.bool)
attention_output = self._attention_mod(
self._memory, self._query, memory_mask=memory_mask)
x = attention_output.read
with self.test_session() as sess:
with self.assertRaises(tf.errors.InvalidArgumentError):
sess.run(x)
评论列表
文章目录