Creating a Pruning Runner - 2.5 English

Vitis AI Optimizer User Guide (UG1333)

Document ID
UG1333
Release Date
2022-06-15
Version
2.5 English

Import modules and prepare input signature:

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) 

Create an iterative pruning runner:

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

Or, a one-step pruning runner:

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