| 1060 | |
| 1061 | |
| 1062 | def _check_shapes_compat(output_tensors, shape_invariants, input_tensors): |
| 1063 | for (t, shape, input_t) in zip(output_tensors, shape_invariants, |
| 1064 | input_tensors): |
| 1065 | if not control_flow_ops._ShapeLessThanOrEqual(t.shape, shape): |
| 1066 | raise ValueError( |
| 1067 | "Input tensor '%s' enters the loop with shape %s, but has " |
| 1068 | "shape %s after one iteration. To allow the shape to vary across " |
| 1069 | "iterations, use the `shape_invariants` argument of tf.while_loop to " |
| 1070 | "specify a less-specific shape." % (input_t.name, shape, t.shape)) |
| 1071 | |
| 1072 | |
| 1073 | def _check_num_inputs_outputs(cond_graph, body_graph, num_flattened_loop_vars): |