einop-0.0.1
توضیحات
-
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | einop-0.0.1 |
| نام | einop |
| نسخه کتابخانه | 0.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Cristian Garcia |
| ایمیل نویسنده | cgarcia.e88@gmail.com |
| آدرس صفحه اصلی | https://cgarciae.github.io/einop |
| آدرس اینترنتی | https://pypi.org/project/einop/ |
| مجوز | MIT |
# Einop
_One op to rule them all_
Einop is a very thin wrapper around [einops](https://github.com/arogozhnikov/einops) that combines `rearrange`, `reduce`, and `repeat` into a single `einop` function. This library is a port of [arogozhnikov/einops#91](https://github.com/arogozhnikov/einops/pull/91) by [Miles Cranmer](https://github.com/MilesCranmer) into a separate library, if at some point that PR is merged use `einop` directly from einops instead.
## Installation
```
pip install einop
```
## Usage
```python
import numpy as np
from einop import einop
x = np.random.uniform(size=(10, 20))
y = einop(x, "height width -> batch width height", batch=32)
assert y.shape == (32, 20, 10)
```
#### Rearrange
```python
einop(x, 'i j k -> k i j').shape
>>> (3, 100, 5)
```
#### Reduction
```python
import numpy as np
from einops import einop
x = np.random.randn(100, 5, 3)
einop(x, 'i j k -> i j', reduction='sum').shape
>>> (100, 5)
```
#### Repeat
```python
einop(x, 'i j k -> i j k l', l=10).shape
(100, 5, 3, 10)
```
نیازمندی
| مقدار | نام |
|---|---|
| >=0.4.0 | einops |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7,<4.0 | Python |
نحوه نصب
نصب پکیج whl einop-0.0.1:
pip install einop-0.0.1.whl
نصب پکیج tar.gz einop-0.0.1:
pip install einop-0.0.1.tar.gz