此 API 具有下列方法:
get_pruning_runner(model, inputs, method)
- model
- 要进行剪枝的
torch.nn.Module
对象。 - inputs
- 单个 torch 或 torch 列表。张量用作为模型推断的输入。它无需采用真实数据。可以采用随机生成的张量,与真实数据的形状和数据类型相同即可。
- method
- 可取“iterative”或“one_step”。
此 API 具有下列方法:
get_pruning_runner(model, inputs, method)
torch.nn.Module
对象。