[Enhancement] Handle the device type of inputs in functions (#137)
* [Enhancement] Handle the device type of inputs in functions * rename and move three fucntions to dist/utils.py * minor refinement * rename dist to torch_dist in utils.py * update unit tests * refine unit tests * add unit tests * fix unit tests * replace Sequence with list and tuple * rename get_backend_device to get_comm_device * fix unit tests * fix unit tests * refactor and add more unit tests * cast_data_device does not support set type
Showing
- mmengine/dist/__init__.py 4 additions, 2 deletionsmmengine/dist/__init__.py
- mmengine/dist/dist.py 100 additions, 91 deletionsmmengine/dist/dist.py
- mmengine/dist/utils.py 188 additions, 24 deletionsmmengine/dist/utils.py
- tests/test_dist/test_dist.py 161 additions, 52 deletionstests/test_dist/test_dist.py
- tests/test_dist/test_utils.py 431 additions, 0 deletionstests/test_dist/test_utils.py
Loading
Please register or sign in to comment