question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loss of functionality in .54 - change in slicing behavior on user defined types

See original GitHub issue

possible dupe of : https://github.com/numba/numba/issues/7355 The following code worked prior to 0.54, but no longer will run:

import numpy as np
import numba as nb

ALT_TYPE = [('Z', np.float64, 3)]
np_alt = np.dtype(ALT_TYPE, align=True)
nb_alt = nb.from_dtype(np_alt)
print(np_alt)
print(nb_alt)


@nb.njit(nb.void(nb_alt[:]))
def new_kern(z):
    z[0]['Z'][:] = 7


dta = np.zeros((1,), dtype=nb_alt)
new_kern(dta)
print(dta)

Yields:

No implementation of function Function(<built-in function setitem>) found for signature:
 
 >>> setitem(nestedarray(float64, (3,)), slice<a:b>, Literal[int](7))
 
There are 16 candidate implementations:
  - Of which 14 did not match due to:
  Overload of function 'setitem': File: <numerous>: Line N/A.
    With argument(s): '(nestedarray(float64, (3,)), slice<a:b>, int64)':
   No match.
  - Of which 2 did not match due to:
  Overload in function 'SetItemBuffer.generic': File: numba\core\typing\arraydecl.py: Line 171.
    With argument(s): '(nestedarray(float64, (3,)), slice<a:b>, int64)':
   Rejected as the implementation raised a specific error:
     TypeError: __init__() got an unexpected keyword argument 'ndim'

Expected behavior: [([7,7,7],)]

The bug affects CUDA as well but this is probably incidental.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
esccommented, Sep 27, 2021

Closing now as #7428 was merged!

0reactions
esccommented, Sep 22, 2021
 💣 zsh» gh pr checkout 7428
remote: Enumerating objects: 18, done.
remote: Counting objects: 100% (18/18), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 18 (delta 11), reused 18 (delta 11), pack-reused 0
Unpacking objects: 100% (18/18), done.
From github.com:numba/numba
 * [new ref]               refs/pull/7428/head -> fix/iss7355_minimal
Switched to branch 'fix/iss7355_minimal'
vhaenel@x86_64-apple-darwin13 [numba_3.8] [numba:fix/iss7355_minimal:★★₃₂★] ~/git/numba
 💣 zsh» make clean && make
...
 💣 zsh» python issue7426.py
{'names':['Z'], 'formats':[('<f8', (3,))], 'offsets':[0], 'itemsize':24, 'aligned':True}
Record(Z[type=nestedarray(float64, (3,));offset=0];24;True)
[([7., 7., 7.],)]

I can confirm that #7428 will fix this too.

can confirm that fixes it

Great, thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rating Motivational Interviewing Fidelity from Thin Slices - NCBI
Monitoring fidelity to psychosocial treatments is critical to dissemination, process and outcome research, and internal validity in efficacy ...
Read more >
(PDF) Thin Slices of Behavior as Cues of Personality and ...
Personality inferences from thin slices of behavior were significantly associated with reports by knowledgeable informants.
Read more >
Detecting Psychopathy From Thin Slices of Behavior
Because of psychopathic individuals' lack of insight into their maladaptive personality features, they may possess blind spots that may be better described.
Read more >
Sliced Inverse Regression for Dimension Reduction
Furthermore, we use a simple step function to estimate the inverse regression curve. ... regression curve E(x I y), which is the slice...
Read more >
SPRED2 loss-of-function causes a recessive Noonan ...
pressing wild-type SPRED2 but not the SPRED2Leu381Hisfs*95 protein. ... behavioral anomalies, skeletal and skin features, as well.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found