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 gh-1279, implement tensor.allclose #1343
Commits on Aug 15, 2023
-
Clean up of operator special methods
1. Removed unused usm_ndarray._clone static C-only method 2. Removed _dispatch* utilities 3. Used direct calls to unary/binary operators in implementation of special methods
Configuration menu - View commit details
-
Copy full SHA for 48c2ad2 - Browse repository at this point
Copy the full SHA 48c2ad2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d9974e - Browse repository at this point
Copy the full SHA 7d9974eView commit details -
Provide cabs private method implementating abs for complex types, paying attention to array-API mandated special values. To work-around gh-1279, use std::hypot to compute value for finite inputs. Compile with -DUSE_STD_ABS_FOR_COMPLEX_TYPES to use std::abs(z) instead of std::hypot(std::real(z), std::imag(z)).
Configuration menu - View commit details
-
Copy full SHA for 5f298e6 - Browse repository at this point
Copy the full SHA 5f298e6View commit details -
This change provides private method csqrt to evaluate square-root for complex types. It handles special values as mandated by array API. The finite input, it provides its own implementation based on std::hypot and std::sqrt for real types instead of calling std::sqrt on finite input of complex type. Compile with -DUSE_STD_SQRT_FOR_COMPLEX_TYPES to use std::sqrt instead of custom implementation. Cursory performance study suggests that custom implementation is at least not worse than std::sqrt one.
Configuration menu - View commit details
-
Copy full SHA for 4a2578f - Browse repository at this point
Copy the full SHA 4a2578fView commit details -
Implements dpctl.tensor.allclose
This utility function is based on symmetric check, unlike numpy.allclose, and verifies that abs(x1-x2) < atol + rtol * max(abs(x1), abs(x2)) This way allclose(x1, x2) is symmetric, and allclose(x1,x2) implies allclose(x2, x1).
Configuration menu - View commit details
-
Copy full SHA for 26862b4 - Browse repository at this point
Copy the full SHA 26862b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for b121d67 - Browse repository at this point
Copy the full SHA b121d67View commit details -
Configuration menu - View commit details
-
Copy full SHA for d60d58e - Browse repository at this point
Copy the full SHA d60d58eView commit details
Commits on Aug 16, 2023
-
1. Aligned default values with those of np.allclose 2. Replaced less test with less_equal to align with NumPy.
Configuration menu - View commit details
-
Copy full SHA for ea6dd27 - Browse repository at this point
Copy the full SHA ea6dd27View commit details -
Also added tests for early exits to improve coverage.
Configuration menu - View commit details
-
Copy full SHA for f36af57 - Browse repository at this point
Copy the full SHA f36af57View commit details -
Configuration menu - View commit details
-
Copy full SHA for a75fff8 - Browse repository at this point
Copy the full SHA a75fff8View commit details -
This changes builds up on gh-1265 and takes into account queue from the pre-allocated buffer, if provided.
Configuration menu - View commit details
-
Copy full SHA for ff3c680 - Browse repository at this point
Copy the full SHA ff3c680View commit details
Commits on Aug 17, 2023
-
Scale down arguments and scale back the result
This improves accuracy at extremes of supported range. Use sycl:: namespace ldexp and ilogb to prevent problem with VS 2017 headers.
Configuration menu - View commit details
-
Copy full SHA for c4312cb - Browse repository at this point
Copy the full SHA c4312cbView commit details -
Avoid using sycl::ilogb, but use own implementation
ilogb would have to pay attention to correctly computing scale of denormal floats, while simpler code suffices. Also use unscaled version in most cases, and scaled version only for very large inputs.
Configuration menu - View commit details
-
Copy full SHA for bb52bb1 - Browse repository at this point
Copy the full SHA bb52bb1View commit details -
Set defines to use std::abs and std::sqrt on Linux
We work around issues with these functions when their implementation is taken from VS 2017 headers on Windows though.
Configuration menu - View commit details
-
Copy full SHA for ba9a595 - Browse repository at this point
Copy the full SHA ba9a595View commit details -
Configuration menu - View commit details
-
Copy full SHA for 142190f - Browse repository at this point
Copy the full SHA 142190fView commit details