You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reduce seems to not accept list of equal-shaped tensors as input - even though the API claims it should. (Just for comparison, rearrange appears to work as expected).
>>> import einops
>>> import numpy as np
>>> a = np.random.rand(3, 4)
>>> b = np.random.rand(3, 4)
>>> out1 = einops.rearrange([a, b], 'i j k -> j i k')
>>> out1.shape
(3, 2, 4)
>>> out2 = einops.reduce([a, b], 'i j k -> j k', 'sum')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/hwpang/miniconda3/envs/nerf-pytorch/lib/python3.7/site-packages/einops/einops.py", line 409, in reduce
return _apply_recipe(recipe, tensor, reduction_type=reduction)
File "/home/hwpang/miniconda3/envs/nerf-pytorch/lib/python3.7/site-packages/einops/einops.py", line 230, in _apply_recipe
backend = get_backend(tensor)
File "/home/hwpang/miniconda3/envs/nerf-pytorch/lib/python3.7/site-packages/einops/_backends.py", line 52, in get_backend
raise RuntimeError('Tensor type unknown to einops {}'.format(type(tensor)))
RuntimeError: Tensor type unknown to einops <class 'list'>
Is the above intended behavior?
The text was updated successfully, but these errors were encountered:
reduce
seems to not accept list of equal-shaped tensors as input - even though the API claims it should. (Just for comparison,rearrange
appears to work as expected).Is the above intended behavior?
The text was updated successfully, but these errors were encountered: