Creating a Sparse Pruner - 3.5 English

Vitis AI User Guide (UG1414)

Document ID
UG1414
Release Date
2023-09-28
Version
3.5 English

The pruner requires two arguments:

  • The model to be pruned
  • The inputs needed by the model for inference
import torch
from pytorch_nndct import SparsePruner

inputs = torch.randn([1, 3, 224, 224], dtype=torch.float32)
pruner = SparsePruner(model, inputs)