| 940 | }; |
| 941 | |
| 942 | Status DynamicShapeRemovingVisitor::DefaultAction(HloInstruction* hlo) { |
| 943 | // Default rule: If input to an op is static, remove dynamism in output. |
| 944 | bool input_is_dynamic = false; |
| 945 | // Default rule: |
| 946 | for (int64 i = 0; i < hlo->operand_count(); ++i) { |
| 947 | if (!hlo->operand(i)->shape().is_static()) { |
| 948 | input_is_dynamic = true; |
| 949 | } |
| 950 | } |
| 951 | |
| 952 | if (!input_is_dynamic) { |
| 953 | hlo->mutable_shape()->clear_dynamic_dimensions(); |
| 954 | } |
| 955 | return Status::OK(); |
| 956 | } |
| 957 | |
| 958 | Status DynamicShapeRemovingVisitor::HandleCustomCall(HloInstruction* hlo) { |
| 959 | if (hlo->custom_call_target() == "SliceToDynamic") { |
nothing calls this directly
no test coverage detected