Skip to content
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

fix: Fix Frontend Failing Test: torch - creation_ops.torch.full #28053

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sgalpha01
Copy link
Contributor

PR Description

Issue was with paddle backend where it didn't support complex type.

>>> ivy.set_backend("paddle")
<module 'ivy.functional.backends.paddle' from '/home/r0gue_shinobi/Desktop/ivy/ivy/functional/backends/paddle/__init__.py'>
>>> size = (1,)
>>> fill_value = ivy.array(ivy.array(-1.+0.j), dtype="complex64")
>>> ivy.full(size, fill_value)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/r0gue_shinobi/Desktop/ivy/ivy/func_wrapper.py", line 1599, in _handle_backend_invalid
    return fn(*args, **kwargs)
  File "/home/r0gue_shinobi/Desktop/ivy/ivy/func_wrapper.py", line 909, in _handle_nestable
    return fn(*args, **kwargs)
  File "/home/r0gue_shinobi/Desktop/ivy/ivy/func_wrapper.py", line 372, in _handle_array_like_without_promotion
    return fn(*args, **kwargs)
  File "/home/r0gue_shinobi/Desktop/ivy/ivy/func_wrapper.py", line 803, in _handle_out_argument
    return fn(*args, out=out, **kwargs)
  File "/home/r0gue_shinobi/Desktop/ivy/ivy/func_wrapper.py", line 466, in _inputs_to_native_shapes
    return fn(*args, **kwargs)
  File "/home/r0gue_shinobi/Desktop/ivy/ivy/func_wrapper.py", line 411, in _inputs_to_native_arrays
    return fn(*new_args, **new_kwargs)
  File "/home/r0gue_shinobi/Desktop/ivy/ivy/func_wrapper.py", line 514, in _outputs_to_ivy_arrays
    ret = fn(*args, **kwargs)
  File "/home/r0gue_shinobi/Desktop/ivy/ivy/func_wrapper.py", line 327, in _handle_array_function
    return fn(*args, **kwargs)
  File "/home/r0gue_shinobi/Desktop/ivy/ivy/func_wrapper.py", line 758, in _handle_device
    with ivy.DefaultDevice(ivy.default_device(dst_dev)):
  File "/home/r0gue_shinobi/Desktop/ivy/ivy/functional/ivy/device.py", line 133, in __exit__
    raise exc_val
  File "/home/r0gue_shinobi/Desktop/ivy/ivy/func_wrapper.py", line 759, in _handle_device
    return ivy.handle_soft_device_variable(*args, fn=fn, **kwargs)
  File "/home/r0gue_shinobi/Desktop/ivy/ivy/functional/backends/paddle/device.py", line 117, in handle_soft_device_variable
    ret = fn(*args, **kwargs)
  File "/home/r0gue_shinobi/Desktop/ivy/ivy/functional/backends/paddle/creation.py", line 236, in full
    ret = paddle.full(shape=shape, fill_value=fill_value, dtype=dtype_)
  File "/home/r0gue_shinobi/.miniconda3/envs/ivy_dev/lib/python3.10/site-packages/paddle/tensor/creation.py", line 1295, in full
    return fill_constant(shape=shape, dtype=dtype, value=fill_value, name=name)
  File "/home/r0gue_shinobi/.miniconda3/envs/ivy_dev/lib/python3.10/site-packages/paddle/tensor/creation.py", line 900, in fill_constant
    value = float(value)
  File "/home/r0gue_shinobi/.miniconda3/envs/ivy_dev/lib/python3.10/site-packages/paddle/base/dygraph/math_op_patch.py", line 112, in _float_
    return float(np.array(var))
TypeError: float() argument must be a string or a real number, not 'complex'

Related Issue

Closes #28052

Checklist

  • Did you add a function?
  • Did you add the tests?
  • Did you run your tests and are your tests passing?
  • Did pre-commit not fail on any check?
  • Did you follow the steps we provided?

Socials

@sgalpha01 sgalpha01 marked this pull request as draft January 25, 2024 21:39
@ivy-leaves ivy-leaves added the PyTorch Frontend Developing the PyTorch Frontend, checklist triggered by commenting add_frontend_checklist label Jan 25, 2024
@joaozenobio joaozenobio removed their assignment Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority PyTorch Frontend Developing the PyTorch Frontend, checklist triggered by commenting add_frontend_checklist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Frontend Failing Test: torch - creation_ops.torch.full
4 participants