创建剪枝运行器 - 3.5 简体中文

Vitis AI 用户指南 (UG1414)

Document ID
UG1414
Release Date
2023-09-28
Version
3.5 简体中文

导入模块并准备输入特征符:

from pytorch_nndct import get_pruning_runner

# The input signature should have the same shape and dtype as the model input.
input_signature = torch.randn([1, 3, 224, 224], dtype=torch.float32) 

创建迭代剪枝运行器:

runner = get_pruning_runner(model, input_signature, 'iterative')

或者单步剪枝运行器:

runner = get_pruning_runner(model, input_signature, 'one_step')