(x, shape)
| 585 | state = cell.zero_state(batch_size, dtype) |
| 586 | |
| 587 | def _assert_has_shape(x, shape): |
| 588 | x_shape = array_ops.shape(x) |
| 589 | packed_shape = array_ops.stack(shape) |
| 590 | return control_flow_ops.Assert( |
| 591 | math_ops.reduce_all(math_ops.equal(x_shape, packed_shape)), |
| 592 | ["Expected shape for Tensor %s is " % x.name, |
| 593 | packed_shape, " but saw shape: ", x_shape]) |
| 594 | |
| 595 | if sequence_length is not None: |
| 596 | # Perform some shape validation |