| 2774 | self._step.report_interval = report_interval |
| 2775 | |
| 2776 | def AddSubstep(self, substep): |
| 2777 | self._assert_can_mutate() |
| 2778 | assert not self.HasNets(), 'Cannot have both network and substeps.' |
| 2779 | if isinstance(substep, ExecutionStep): |
| 2780 | substep._notify_is_used() |
| 2781 | if not substep.HasNets() and not substep.HasSubsteps(): |
| 2782 | return self |
| 2783 | for net in substep.Nets(): |
| 2784 | _add_net_to_dict(self._net_dict, net) |
| 2785 | self._substeps.append(substep) |
| 2786 | proto = substep.Proto() |
| 2787 | else: |
| 2788 | proto = substep |
| 2789 | self._step.substep.add().CopyFrom(proto) |
| 2790 | return self |
| 2791 | |
| 2792 | def SetConcurrentSubsteps(self, concurrent_substeps): |
| 2793 | self._assert_can_mutate() |