Skip to main content

pnnx python wrapper

Project description

pnnx_package

pnnx python wrapper

How to use

pip install pnnx

example

import pnnx
import torch
import torchvision

def test_pnnx_export():
    resnet_test_model = torchvision.models.resnet18()
    x = torch.rand(1, 3, 224, 224)
    pnnx.export(resnet_test_model, x)

if __name__ == "__main__":
    test_pnnx_export()

You should combine inputs use tuple, e.g. inputshape, moduleop... Here is a more complex example:

    pnnx.export(your_model, inputshape=(x,y), inputshape2=(x2,y2), optlevel=0, pnnxparam="model.pnnx.param",  device= "gpu",  moduleop =("models.common.Focus","models.yolo.Detect"))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pnnx-0.0.4.tar.gz (49.0 MB view hashes)

Uploaded Source

Built Distribution

pnnx-0.0.4-py3-none-any.whl (49.4 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page