MCPcopy Create free account
hub / github.com/alibaba/bigcomputing / _assert_has_shape

Function _assert_has_shape

DIEN/rnn.py:587–593  ·  view source on GitHub ↗
(x, shape)

Source from the content-addressed store, hash-verified

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

Callers 1

dynamic_rnnFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected