Implement `np.ascontiguousarray` for Numba scalars
See original GitHub issueThe conversion for np.ascontiguousarray doesn’t appear to handle scalar inputs:
import numpy as np
import numba as nb
@nb.njit
def test_fn(x):
return np.ascontiguousarray(x)
test_fn(1)
# ...
# TypingError: Failed in nopython mode pipeline (step: nopython frontend)
# No implementation of function Function(<function ascontiguousarray at 0x7fdd294aab00>) found for signature:
#
# >>> ascontiguousarray(int64)
np.ascontiguousarray(1)
# array([1])
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Supported NumPy features - Numba
Numpy arrays of any of the scalar types above are supported, regardless of the shape or layout. Array access¶. Arrays support normal iteration....
Read more >numpy.ascontiguousarray() in Python - GeeksforGeeks
numpy.ascontiguousarray() function is used when we want to return a contiguous ... This includes scalars, lists, lists of tuples, tuples, ...
Read more >Creating arrays on the GPU with numba in python using Cuda
So it's possible to create a vectorize ufunc that works on an array and a scalar, for example. That means each worker will...
Read more >Only size-1 arrays can be converted to Python scalars
This error occurs most often when you attempt to use np.int() to convert a NumPy array of float values to an array of...
Read more >numpy.array — NumPy v1.24 Manual
If object is a scalar, a 0-dimensional array containing object is returned. ... Specifies the minimum number of dimensions that the resulting array...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi @gmarkall , I’m new here and want to take this one as my first issue?
Indeed, thank you for the ping!