[Caffe2] Change shape_hints format (#39100)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39100
The old shape_hints format has a few cons:
- ',' is used to separate <model_id>:<shape_hints> pairs, as well as delimiter for dims in the <shape_hints>, which is an obvious bug
- it cannot handle the case of having ':' in tensor names
The new shape_hints format uses '::' to delimit <model_id> and <shape_hints>, ';' to delimit <model_id>::<shape_hints> pairs. Inside <shape_hints>, '|' is used to separate <tensor>,<shape> pairs, and ',' is used to delimit <tensor> and <shape>, as well as the dimensions inside <shape>.
Test Plan:
```
buck test //caffe2/caffe2/fb/opt:shape_info_utils_test
```
AI/AF canary:
https://www.internalfb.com/intern/ads/canary/426980448937212687
https://www.internalfb.com/intern/ads/canary/426980529105312403
Reviewed By: yinghai
Differential Revision: D21656832
fbshipit-source-id: 9dec4b5586d093ddb814c3f15041a57d45a3de76