Metadata-Version: 2.4
Name: pywebnn
Version: 0.5.12
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Dist: numpy>=1.20.0
Requires-Dist: onnxruntime>=1.23.0
Requires-Dist: pytest>=7.0 ; extra == 'test'
Requires-Dist: pytest-asyncio ; extra == 'test'
Provides-Extra: test
License-File: LICENSE
Summary: Python bindings for W3C WebNN specification
Keywords: webnn,neural-network,machine-learning,onnx,coreml,ai,graph,inference
Author-email: Tarek Ziade <tarek@ziade.org>
License: Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://github.com/rustnn/pywebnn#readme
Project-URL: Homepage, https://github.com/rustnn/pywebnn
Project-URL: Issues, https://github.com/rustnn/pywebnn/issues
Project-URL: Repository, https://github.com/rustnn/pywebnn

# pywebnn

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

## Install

`pywebnn` is available on PyPI:

```bash
pip install pywebnn
```

## Docs

Full documentation is published on GitHub Pages:

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

## Quick Start

```python
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

- GitHub: <https://github.com/rustnn/pywebnn>
- PyPI: <https://pypi.org/project/pywebnn/>
- Issues: <https://github.com/rustnn/pywebnn/issues>

