def testNotAMultiple(self):
num_unroll = 3 # Not a divisor of value_length -
# so padding would have been necessary.
+
+ # Use placeholder_with_default in sequences to make sure we get runtime
+ # error instead of shape inference error
+ sequences = {
+ "seq1": array_ops.placeholder_with_default(self.sequences["seq1"],
+ shape=(None, 5)),
+ "seq2": array_ops.placeholder_with_default(self.sequences["seq2"],
+ shape=(None, 4, 2)),
+ "seq3": self.sequences["seq3"],
+ "seq4": self.sequences["seq4"],
+ }
+
with self.test_session() as sess:
with self.assertRaisesRegexp(errors_impl.InvalidArgumentError,
".*should be a multiple of: 3, but saw "
with coord.stop_on_exception():
next_batch = sqss.batch_sequences_with_states(
input_key=self.key,
- input_sequences=self.sequences,
+ input_sequences=sequences,
input_context=self.context,
input_length=3,
initial_states=self.initial_states,
expected_seq4_batch2=expected_seq4_batch2)
+class BatchSequencesWithStatesTestWithCApi(BatchSequencesWithStatesTest):
+
+ def setUp(self):
+ self._prev_value = ops._USE_C_API
+ ops._USE_C_API = True
+ super(BatchSequencesWithStatesTestWithCApi, self).setUp()
+
+ def tearDown(self):
+ super(BatchSequencesWithStatesTestWithCApi, self).tearDown()
+ ops._USE_C_API = self._prev_value
+
+
class PaddingTest(test.TestCase):
def testPaddingInvalidLengths(self):