- Notifications
You must be signed in to change notification settings - Fork 5.9k
Closed
Labels
PFCCPaddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfccPaddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfccgood first issuestatus/new-issue新建新建type/feature-request新需求申请新需求申请
Description
需求描述 Feature Description
related issue: #34220
related PR: arogozhnikov/einops#122
I just want tu use einops with paddlepaddle, just like the following :
import paddle import torch import numpy as np from einops import rearrange x_np = np.random.randn(1, 2, 3) print(rearrange(x_np, "a s d -> s a d")) x_torch = torch.randn([1, 2, 3]) print(rearrange(x_torch, "a s d -> s a d")) x_pd = paddle.randn([1, 2, 3]) rearrange(x_pd, "a s d -> s a d")The last line of code reports an error as follows:
RuntimeError Traceback (most recent call last)
in
12
13 x_pd = paddle.randn([1, 2, 3])
---> 14 rearrange(x_pd, "a s d -> s a d")
3 frames
/usr/local/lib/python3.7/dist-packages/einops/_backends.py in get_backend(tensor)
50 return backend
51
---> 52 raise RuntimeError('Tensor type unknown to einops {}'.format(type(tensor)))
53
54
RuntimeError: Tensor type unknown to einops <class 'paddle.Tensor'>
The official website of einops says:
It seems that Einops doesn't work with the PaddlePaddle framework now.替代实现 Alternatives
you can transform a paddle Tensor to a numpy array to work with einops
Metadata
Metadata
Labels
PFCCPaddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfccPaddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfccgood first issuestatus/new-issue新建新建type/feature-request新需求申请新需求申请
