pywebnn 0.5.12


pip install pywebnn

  Latest version

Released: May 04, 2026


Meta
Author: Tarek Ziade
Requires Python: >=3.10

Classifiers

Development Status
  • 4 - Beta

Intended Audience
  • Developers
  • Science/Research

License
  • OSI Approved :: Apache Software License

Operating System
  • OS Independent

Programming Language
  • Python :: 3
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Rust

Topic
  • Scientific/Engineering :: Artificial Intelligence

pywebnn

Python bindings for the W3C WebNN API, powered by rustnn.

Install

pywebnn is available on PyPI:

pip install pywebnn

Docs

Full documentation is published on GitHub Pages:

https://rustnn.github.io/pywebnn/

Quick Start

import numpy as np
import webnn

ml = webnn.ML()
context = ml.create_context(device_type="cpu")
builder = context.create_graph_builder()

x = builder.input("x", [2, 3], "float32")
y = builder.input("y", [2, 3], "float32")
out = builder.relu(builder.add(x, y))
graph = builder.build({"output": out})

result = context.compute(
    graph,
    {
        "x": np.array([[1, 2, 3], [4, 5, 6]], dtype=np.float32),
        "y": np.array([[0.1, 0.2, 0.3], [0.4, 0.5, 0.6]], dtype=np.float32),
    },
)
print(result["output"])

Links

Extras:
Dependencies:
numpy (>=1.20.0)
onnxruntime (>=1.23.0)