Giter VIP home page Giter VIP logo

Comments (10)

magnatelee avatar magnatelee commented on August 30, 2024

Should be fixed by 8b85c00. @piyueh can you pull and try again?

from cunumeric.

piyueh avatar piyueh commented on August 30, 2024

@magnatelee It's working now. But there's a minor difference in the outputs of vanilla NumPy and Legate NumPy. Vanilla NumPy returns a Python's native bool, while Legate NumPy returns a 1D boolean ndarray with shape (1,). For example, the above example code returns:

True
[ True]

However, this is a minor issue for me.

I'll close the issue if you think this behavior (i.e., not returning a native bool) will not be changed soon.

from cunumeric.

magnatelee avatar magnatelee commented on August 30, 2024

I think I can fix it quickly, so let's keep this open.

from cunumeric.

magnatelee avatar magnatelee commented on August 30, 2024

Please pull and try again.

from cunumeric.

piyueh avatar piyueh commented on August 30, 2024

@magnatelee Thanks! It's working. Closing the issue.

from cunumeric.

piyueh avatar piyueh commented on August 30, 2024

@magnatelee I reopened this issue because if there's no -lg:numpy:test flag, the test failed. This is the error traceback tested with legate --cpus 1 ./test.py:

[0 - 7f77b186f000]    0.819757 {6}{python}: python exception occurred within task:
Traceback (most recent call last):
  File "<prefix>/lib/python3.8/site-packages/legion_top.py", line 408, in legion_python_main
    run_path(args[start], run_name='__main__')
  File "<prefix>/lib/python3.8/site-packages/legion_top.py", line 200, in run_path
    exec(code, module.__dict__, module.__dict__)
  File "./test.py", line 10, in <module>
    print(lnp.allclose(la, 1e-1))
  File "<prefix>/lib/python3.8/site-packages/legate/numpy/module.py", line 459, in allclose
    return ndarray.perform_binary_reduction(
  File "<prefix>/lib/python3.8/site-packages/legate/numpy/array.py", line 2068, in perform_binary_reduction
    dst._thunk.binary_reduction(
  File "<prefix>/lib/python3.8/site-packages/legate/numpy/eager.py", line 947, in binary_reduction
    self.array[:] = np.allclose(
IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed

from cunumeric.

magnatelee avatar magnatelee commented on August 30, 2024

Should be fixed now. Please pull and try again.

from cunumeric.

piyueh avatar piyueh commented on August 30, 2024

Hi, I got this error:

[0 - 7f81bbd5c7c0]    0.742322 {6}{python}: python exception occurred within task:
Traceback (most recent call last):
  File "<prefix>/lib/python3.8/site-packages/legion_top.py", line 408, in legion_python_main
    run_path(args[start], run_name='__main__')
  File "<prefix>/lib/python3.8/site-packages/legion_top.py", line 200, in run_path
    exec(code, module.__dict__, module.__dict__)
  File "./test.py", line 10, in <module>
    print(lnp.allclose(la, 1e-1))
  File "<prefix>/lib/python3.8/site-packages/legate/numpy/array.py", line 770, in __str__
    self._thunk.get_scalar_array(stacklevel=2), self.shape
  File "<prefix>/lib/python3.8/site-packages/legate/numpy/eager.py", line 159, in get_scalar_array
    return self.array.reshape(())
AttributeError: 'bool' object has no attribute 'reshape'

from cunumeric.

lightsighter avatar lightsighter commented on August 30, 2024

Please pull and try again with febd3bf

from cunumeric.

piyueh avatar piyueh commented on August 30, 2024

It wroks. Thanks! Closing the issue.

from cunumeric.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.