Replaces old_value with (old_value).lower().
(parent, old_value)
| 2266 | pasta.base.formatting.set(new_value, "suffix", ")") |
| 2267 | |
| 2268 | def _replace_mode(parent, old_value): |
| 2269 | """Replaces old_value with (old_value).lower().""" |
| 2270 | new_value = pasta.parse("mode.lower()") |
| 2271 | mode = new_value.body[0].value.func |
| 2272 | pasta.ast_utils.replace_child(mode, mode.value, old_value) |
| 2273 | |
| 2274 | # This copies the prefix and suffix on old_value to new_value. |
| 2275 | pasta.ast_utils.replace_child(parent, old_value, new_value) |
| 2276 | |
| 2277 | # Put parentheses around keep_prob.value (and remove the old prefix/ |
| 2278 | # suffix, they should only be around new_value). |
| 2279 | pasta.base.formatting.set(old_value, "prefix", "(") |
| 2280 | pasta.base.formatting.set(old_value, "suffix", ")") |
| 2281 | |
| 2282 | # Need to keep track of scale because slim & keras |
| 2283 | # have different defaults |
no test coverage detected