Skip to content

Outer function does not work with vectors of float32 type #1203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DenisScherbakov opened this issue Oct 18, 2022 · 4 comments
Closed

Outer function does not work with vectors of float32 type #1203

DenisScherbakov opened this issue Oct 18, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@DenisScherbakov
Copy link
Contributor

Here is test code:

import dpnp
dtype = dpnp.float32
a = dpnp.array([0.1, 0.2, 0,3, 0.4, 0.5]).astype(dtype)
b = dpnp.array([0.1, 0.2, 0,3, 0.4, 0.5]).astype(dtype)
c = dpnp.outer(a,b)

print(c)

Error message is

File /localdisk/work/dscherba/miniconda3/lib/python3.9/site-packages/dpnp/dpnp_iface_linearalgebra.py:318, in outer(x1, x2, **kwargs)
    316 x2_desc = dpnp.get_dpnp_descriptor(x2)
    317 if x1_desc and x2_desc and not kwargs:
--> 318     return dpnp_outer(x1_desc, x2_desc).get_pyobj()
    320 return call_origin(numpy.outer, x1, x2, **kwargs)

File dpnp/dpnp_algo/dpnp_algo_linearalgebra.pyx:323, in dpnp.dpnp_algo.dpnp_algo.dpnp_outer()

File dpnp/dpnp_algo/dpnp_algo_linearalgebra.pyx:330, in dpnp.dpnp_algo.dpnp_algo.dpnp_outer()

AttributeError: 'dpctl.tensor._usmarray.usm_ndarray' object has no attribute 'flat'
@DenisScherbakov DenisScherbakov added the bug Something isn't working label Oct 18, 2022
@antonwolfy
Copy link
Contributor

@DenisScherbakov, the issue is fixed in scope of PR #1205

@antonwolfy
Copy link
Contributor

The fix is merged into gold/2021 by PR #1209.

@DenisScherbakov
Copy link
Contributor Author

Currently, dpnp.outer() failing due to #1238 :

File "/home/gta/test2.py", line 13, in <module>
    c = outer(a,b)
  File "/home/gta/test2.py", line 9, in outer
    return dpnp.outer(a,b)
  File "/home/gta/ff2899c2ac822b2d/envs/intelpython_dpbench/lib/python3.9/site-packages/dpnp/dpnp_iface_linearalgebra.py", line 318, in outer
    return dpnp_outer(x1_desc, x2_desc).get_pyobj()
  File "dpnp/dpnp_algo/dpnp_algo_linearalgebra.pyx", line 369, in dpnp.dpnp_algo.dpnp_algo.dpnp_outer
  File "dpnp/dpnp_algo/dpnp_algo_linearalgebra.pyx", line 388, in dpnp.dpnp_algo.dpnp_algo.dpnp_outer
  File "/home/gta/ff2899c2ac822b2d/envs/intelpython_dpbench/lib/python3.9/site-packages/dpnp/dpnp_array.py", line 228, in __mul__
    return dpnp.multiply(self, other)
  File "/home/gta/ff2899c2ac822b2d/envs/intelpython_dpbench/lib/python3.9/site-packages/dpnp/dpnp_iface_mathematical.py", line 1125, in multiply
    return call_origin(numpy.multiply, x1, x2, dtype=dtype, out=out, where=where, **kwargs)
  File "dpnp/dpnp_utils/dpnp_algo_utils.pyx", line 120, in dpnp.dpnp_utils.dpnp_algo_utils.call_origin
NotImplementedError: Requested funtion=multiply with args=(<dpnp.dpnp_array.dpnp_array object at 0x7fd513309dc0>, <dpnp.dpnp_array.dpnp_array object at 0x7fd513309e20>) and kwargs={'dtype': None, 'out': None, 'where': True} isn't currently supported and would fall back on NumPy implementation. Define enviroment variable `DPNP_RAISE_EXCEPION_ON_NUMPY_FALLBACK` to `0` if the fall back is required to be supported without rasing an exception.

@antonwolfy antonwolfy self-assigned this Dec 2, 2022
@DenisScherbakov
Copy link
Contributor Author

Problem not observed with latest fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants