• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IntelPython / dpctl / 5649912819
86%

Build:
DEFAULT BRANCH: master
Ran 24 Jul 2023 09:58PM UTC
Jobs 1
Files 69
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
5649912819

push

github

web-flow
Implements logaddexp and hypot (#1272)

* Implements logaddexp and hypot

* BinaryElementwiseFunc get acceptance_fn parameter, set individually for tensor.divide

The _find_buf_dtype2 must stay consistent with _find_buf_dtype in that for
binary_fn that can be expressed via
    unary_fn(other_binary_fn(unary_fn(in1), unary_fn(in2))),
e.g. logaddexp(x1, x2) == log(exp(x1) + exp(x2))
the promotion of integral types to fp type must be consistence with both
evaluation.

The special-casing, necessary for proper working of dpt.divide, where
dpt.divide(dpt.asarray(1, dtype="i1"), dpt.asarray(1, dtype="u1")) should
give default fp type resulted in
 logaddexp(dpt.asarray(1, dtype="i1"), dpt.asarray(1, dtype="u1"))
returning array of different data-type than if evaluated alternatively,
since dpt.exp(dpt.asarray(1, dtype="i1")) and dpt.exp(dpt.asarray(1, dtype="u1"))
both gave float16 arrays, and the result was of float16 data type.

Now, both behaviors are fixed:

```
In [5]: dpt.log(dpt.add(dpt.exp(dpt.asarray(1, dtype="u1")), dpt.exp(dpt.asarray(1, dtype="i1"))))
Out[5]: usm_ndarray(1.693, dtype=float16)

In [6]: dpt.logaddexp(dpt.asarray(1, dtype="u1"), dpt.asarray(1, dtype="i1"))
Out[6]: usm_ndarray(1.693, dtype=float16)

In [7]: dpt.divide(dpt.asarray(1, dtype="u1"), dpt.asarray(1, dtype="i1"))
Out[7]: usm_ndarray(1., dtype=float32)
```

* Only try calling _inplace if inplace function is defined

* Since logaddexp is not defined for complex types, do not try complex Python scalar

* Implement logaddexp in numerically stable way

* Added missing argument

* Fixed computing allclose testing tolerance in test_dtype_matrix test

When NumPy's result has coarser dtype than that of DPCTL we must use
the largest resolution from each dtype.

* Calls of the type log(1 + X) changed to log1p(X) in logaddexp

---------

Co-authored-by: Oleksandr Pavlyk <oleksandr.pavlyk@intel.com>

2282 of 2796 branches covered (81.62%)

Branch coverage included in aggregate %.

28 of 33 new or added lines in 3 files covered. (84.85%)

8309 of 9928 relevant lines covered (83.69%)

6073.61 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
5
88.35
-0.1% dpctl/tensor/_elementwise_common.py
Jobs
ID Job ID Ran Files Coverage
1 5649912819.1 24 Jul 2023 09:58PM UTC 94
75.33
Source Files on build 5649912819
  • Tree
  • List 69
  • Changed 27
  • Source Changed 0
  • Coverage Changed 27
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 616c21eb on github
  • Prev Build on master (#5626043909)
  • Next Build on master (#5661538176)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc