モジュールをインポートし、入力シグネチャを準備します。
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')