MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _assert_has_shape

Function _assert_has_shape

tensorflow/python/ops/rnn.py:682–689  ·  view source on GitHub ↗
(x, shape)

Source from the content-addressed store, hash-verified

680 state = cell.zero_state(batch_size, dtype)
681
682 def _assert_has_shape(x, shape):
683 x_shape = array_ops.shape(x)
684 packed_shape = array_ops.stack(shape)
685 return control_flow_ops.Assert(
686 math_ops.reduce_all(math_ops.equal(x_shape, packed_shape)), [
687 "Expected shape for Tensor %s is " % x.name, packed_shape,
688 " but saw shape: ", x_shape
689 ])
690
691 if not context.executing_eagerly() and sequence_length is not None:
692 # Perform some shape validation

Callers 1

dynamic_rnnFunction · 0.70

Calls 3

equalMethod · 0.80
shapeMethod · 0.45
stackMethod · 0.45

Tested by

no test coverage detected