(branch_idx, error_detail)
| 699 | """Raises an error if `graphs` have different outputs.""" |
| 700 | |
| 701 | def error(branch_idx, error_detail): |
| 702 | raise TypeError( |
| 703 | "{b0_name} and {bn_name} arguments to {op_name} must have the same " |
| 704 | "number, type, and overall structure of return values.\n" |
| 705 | "\n" |
| 706 | "{b0_name} output: {b0_out}\n" |
| 707 | "{bn_name} output: {bn_out}\n" |
| 708 | "\n" |
| 709 | "Error details:\n" |
| 710 | "{detail}".format( |
| 711 | b0_name="true_fn" if op_type == _COND else "branches[0]", |
| 712 | bn_name=("false_fn" if op_type == _COND else |
| 713 | "branches[{}]".format(branch_idx)), |
| 714 | op_name="tf.cond" if op_type == _COND else "tf.switch_case", |
| 715 | b0_out=graphs[0].structured_outputs, |
| 716 | bn_out=graphs[branch_idx].structured_outputs, |
| 717 | detail=error_detail)) |
| 718 | |
| 719 | for b in range(1, len(graphs)): |
| 720 | try: |
no test coverage detected