| 390 | } // namespace |
| 391 | |
| 392 | StatusOr<bool> ReshapeMover::Run(HloModule* module) { |
| 393 | bool changed = false; |
| 394 | VLOG(2) << "Pre ReshapeMover HLO:"; |
| 395 | XLA_VLOG_LINES(2, module->ToString()); |
| 396 | for (auto* comp : module->MakeNonfusionComputations()) { |
| 397 | HloInstructionSet reshape_candidates; |
| 398 | for (HloInstruction* instruction : comp->instructions()) { |
| 399 | if (IsReshapeMoveCandidate(instruction)) { |
| 400 | reshape_candidates.insert(instruction); |
| 401 | } |
| 402 | } |
| 403 | TF_ASSIGN_OR_RETURN(bool did_change, |
| 404 | TryReshapeMoveOnCandidates(&reshape_candidates)); |
| 405 | changed |= did_change; |
| 406 | } |
| 407 | VLOG(2) << "Post ReshapeMover HLO:"; |
| 408 | XLA_VLOG_LINES(2, module->ToString()); |
| 409 | return changed; |
| 410 | } |
| 411 | |
| 412 | } // namespace xla |
nothing calls this directly
no test coverage detected