pytorch/binaries
Xuehai Pan a229b4526f [BE] Prefer dash over underscore in command-line options (#94505)
Preferring dash over underscore in command-line options. Add `--command-arg-name` to the argument parser. The old arguments with underscores `--command_arg_name` are kept for backward compatibility.

Both dashes and underscores are used in the PyTorch codebase. Some argument parsers only have dashes or only have underscores in arguments. For example, the `torchrun` utility for distributed training only accepts underscore arguments (e.g., `--master_port`). The dashes are more common in other command-line tools. And it looks to be the default choice in the Python standard library:

`argparse.BooleanOptionalAction`: 4a9dff0e5a/Lib/argparse.py (L893-L895)

```python
class BooleanOptionalAction(Action):
    def __init__(...):
            if option_string.startswith('--'):
                option_string = '--no-' + option_string[2:]
                _option_strings.append(option_string)
```

It adds `--no-argname`, not `--no_argname`. Also typing `_` need to press the shift or the caps-lock key than `-`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/94505
Approved by: https://github.com/ezyang, https://github.com/seemethere
2023-02-09 20:16:49 +00:00
..
bench_gen [BE] Prefer dash over underscore in command-line options (#94505) 2023-02-09 20:16:49 +00:00
aot_model_compiler.cc
at_launch_benchmark.cc
benchmark_args.h
benchmark_helper.cc
benchmark_helper.h
caffe2_benchmark.cc
CMakeLists.txt Remove caffe2 mobile (#84338) 2022-09-08 01:49:55 +00:00
compare_models_torch.cc
convert_and_benchmark.cc
convert_caffe_image_db.cc
convert_db.cc
convert_encoded_to_raw_leveldb.cc
convert_image_to_tensor.cc
core_overhead_benchmark_gpu.cc
core_overhead_benchmark.cc
db_throughput.cc
dump_operator_names.cc
inspect_gpu.cc
intra_inter_benchmark.cc
lite_interpreter_model_load.cc
load_benchmark_torch.cc
make_cifar_db.cc
make_image_db.cc
make_mnist_db.cc
optimize_for_mobile.cc [Vulkan] Add support for Optimization Blocklist to Vulkan Rewrite (#87431) 2022-10-31 14:15:51 +00:00
parallel_info.cc
predictor_verifier.cc
print_core_object_sizes_gpu.cc
print_registered_core_operators.cc
record_function_benchmark.cc
run_plan_mpi.cc
run_plan.cc
speed_benchmark_torch.cc [Vulkan] Add Vulkan Rewrite to Transfer Inputs and Outputs to Vulkan and CPU Backends Respectively (#87432) 2022-10-31 14:18:45 +00:00
speed_benchmark.cc
split_db.cc
tsv_2_proto.cc
tutorial_blob.cc
zmq_feeder.cc