| 35 | namespace xla { |
| 36 | |
| 37 | string HloModuleGroupMetadata::TrackedInstruction::ToString() const { |
| 38 | string repr = |
| 39 | (instruction_ != nullptr) ? instruction_->ToShortString() : "NULL"; |
| 40 | switch (kind_) { |
| 41 | case ComputationKind::kInvalid: |
| 42 | repr += ":INVALID"; |
| 43 | break; |
| 44 | case ComputationKind::kWhileCondition: |
| 45 | repr += ":WHILE_CONDITION"; |
| 46 | break; |
| 47 | case ComputationKind::kWhileBody: |
| 48 | repr += ":WHILE_BODY"; |
| 49 | break; |
| 50 | case ComputationKind::kConditionalBranch: |
| 51 | repr += absl::StrCat(":CONDITIONAL_BRANCH_", index_); |
| 52 | break; |
| 53 | case ComputationKind::kCallFunction: |
| 54 | repr += ":CALL"; |
| 55 | break; |
| 56 | } |
| 57 | return repr; |
| 58 | } |
| 59 | |
| 60 | /* static */ StatusOr<std::unique_ptr<HloModuleGroupMetadata>> |
| 61 | HloModuleGroupMetadata::Build(absl::Span<HloModule* const> modules) { |
no test coverage detected