https://stackoverflow.com/questions/15008758/parsing-boolean-values-with-argparse
(v)
| 107 | |
| 108 | |
| 109 | def str2bool(v): |
| 110 | """ |
| 111 | https://stackoverflow.com/questions/15008758/parsing-boolean-values-with-argparse |
| 112 | """ |
| 113 | if isinstance(v, bool): |
| 114 | return v |
| 115 | if v.lower() in ("yes", "true", "t", "y", "1"): |
| 116 | return True |
| 117 | elif v.lower() in ("no", "false", "f", "n", "0"): |
| 118 | return False |
| 119 | else: |
| 120 | raise argparse.ArgumentTypeError("boolean value expected") |
| 121 | |
| 122 | |
| 123 | def convert_resnet(checkpoint, new_checkpoint, old_prefix, new_prefix, has_skip=False): |
no outgoing calls
no test coverage detected
searching dependent graphs…