问题描述:
使用如下代码,可以打印具体cell的参数shape设定,但无法打印输入输出shape。
for cell_name, cell in net.cells_and_names():
if isinstance(cell, nn.Conv2d):
print(cell_name, [cell.out_channels, cell.in_channels, cell.kernel_size[0], cell.kernel_size[1]], cell.stride, cell.padding, cell.dilation, cell.group)
请问,有什么脚本或命令可以完成问题所示目标?
解答:
输出shape可以通过保存ir图获得
https://www.mindspore.cn/docs/programming_guide/zh-CN/r1.5/design/mindir.html