Added serialization of parameters for leaf modules (#47729)
Summary:
This adds the serialization of parameters of leaf nodes to the json serialization.
Specifically __constants__ of the leaf module is serialized as parameters in the JSON.
It also adds type/shape to leaf modules as well.
```
{
"shape": "[3, 3, 1, 1]",
"dtype": "torch.float32",
"parameters": {
"name": "Conv2d",
"stride": [
1,
1
],
"padding": [
0,
0
],
"dilation": [
1,
1
],
"groups": 1,
"padding_mode": "zeros",
"output_padding": [
0,
0
],
"in_channels": 3,
"out_channels": 3,
"kernel_size": [
2,
2
]
},
"target": "conv",
"op_code": "call_module",
"name": "conv",
"args": [
{
"is_node": true,
"name": "c"
}
],
"kwargs": {}
},
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/47729
Reviewed By: ailzhang
Differential Revision: D24901632
Pulled By: gcatron
fbshipit-source-id: 7f2d923937042b60819c58fd180b426a3733ff5f