A pytorch perf decorator
Project description
PyTorch Perf
Install
pip install -U pytorch-perf
To verify a successful installation:
python -c "from torchperf import info; info.show()"
Usage
import torch
from torchperf import perf, info
info.show()
N = 100
x = torch.rand(N, N, device="cuda")
results = []
repeats = 100
@perf(o=results, n=repeats)
def mul(x, y):
return x * y
z = mul(x, x)
print(results[:5])
print("avg:", sum(results)/len(results))
@perf(n=repeats)
def mul(x, y):
return x * y
z = mul(x, x)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytorch-perf-0.0.3.tar.gz
(5.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytorch-perf-0.0.3.tar.gz.
File metadata
- Download URL: pytorch-perf-0.0.3.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77372c9c008a5c1725c62322cecbb2e58270b54f9787536fa61c01b7d6de0777
|
|
| MD5 |
b58680bfbe4205bb923f6b3e897b1938
|
|
| BLAKE2b-256 |
3dc0f765a6763cd9a3e13bdfca7ff6459de25175e6da6abcae357ae1a54e51be
|
File details
Details for the file pytorch_perf-0.0.3-py3-none-any.whl.
File metadata
- Download URL: pytorch_perf-0.0.3-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32c407cee223e93b713bb43878712048e954ca5ea7e09991fa236a60bf940a5c
|
|
| MD5 |
8e11cb9992e381ce489ddc7b3eac9535
|
|
| BLAKE2b-256 |
f1832a5ee03fa224d124e8ef161e59a3f389ec2b6b1b30545000e64af1172049
|