HomeDocumentation
DocumentationLog In
Documentation

How to Use

PyNetsPresso

For first-time use or to obtain detailed information about PyNetsPresso, please visit https://github.com/Nota-NetsPresso/PyNetsPresso.

# 1. Declare compressor
compressor = netspresso.compressor_v2()

# 2. Run automatic compression
compression_result = compressor.automatic_compression(
    input_shapes=[{"batch": 1, "channel": 3, "dimension": [224, 224]}],
    input_model_path="./examples/sample_models/graphmodule.pt",
    output_dir="./outputs/compressed/pytorch_automatic_compression",
    compression_ratio=0.5,
)