Skip to main content

Questions tagged [stride]

The stride of an array is the number of locations in memory between beginnings of successive array elements, measured in bytes or in units of the size of the array's elements. Arrays may have a stride larger than their elements' width in bytes, which are called a non-unit stride. One particular use of non-unit stride is for images, when creating subimages without copying the pixel data.

stride
1 vote
3 answers
58 views

Equivalence between reshape, strides and transpose? (numpy)

i am sorry for the very naive question. I have these lines of numpy code, with a transpose at the beginning, and strides and reshape are used afterward. I wonder if by re-ordering indices in reshape ...
pierre_j's user avatar
  • 939
0 votes
0 answers
18 views

What is the opposite of stride?

Suppose I have a 5-dimensional array of the following shape: (2, 3, 4, 5, 6) For arrays with row-major layout the stride for the 3rd dimension is then equal to 5x6. For the 4th dimension the stride is ...
drgs's user avatar
  • 388
1 vote
0 answers
19 views

Kotlin - how can I create a list of numbers between a range and stepped by a certain value [duplicate]

In Kotlin, I'm trying to create a val with a list of numbers within a specific range, incremented by 1.5. How can I do this? I've tried the below, but I'm getting an error with "step". val ...
Vaz's user avatar
  • 508
2 votes
1 answer
121 views

What stride should I use for matrices in CUDA for the fastest possible speed?

I'm working with matrices that range in size from 2,000x2,000 up to 5,000x5,000, doing operations such as multiplication and QR decomposition. I'm curious if, for example, I should align the stride by ...
meisel's user avatar
  • 2,347
2 votes
1 answer
350 views

Does PyTorch support stride_tricks as in numpy.lib.stride_tricks.as_strided?

It is possible to make cool things by changing the strides of an array in Numpy like this: import numpy as np from numpy.lib.stride_tricks import as_strided a = np.arange(15).reshape(3,5) print(a) # ...
Fırat Kıyak's user avatar
3 votes
3 answers
115 views

How strided memcpy(3) works in libvpx

I'm trying to understand the following function in libvpx (vp8/common/reconinter.c): void vp8_copy_mem16x16_c(unsigned char *src, int src_stride, unsigned char *dst, int ...
Yuuta Liang's user avatar
0 votes
0 answers
189 views

Why are sizes and strides of SIMD3<Float> and SCNVector different?

So when I was working with buffers I was having something like UnsafeRawPointer (which consisted of SCNVector3) and I was casting it to UnsafeBufferPointer<SIMD3<Float>>. And then I saw ...
Dzmitry Valkovich's user avatar
0 votes
2 answers
154 views

How to use cupy.lib.stride_tricks.as_strided(x, shape=None, strides=None)

I was using: np.lib.stride_tricks.sliding_window_view with a 1D-array and two parameters (the array and the length of the subset n) to slice it into slices of n elements (n < 1D-array.shape, of ...
tibibou's user avatar
  • 142
2 votes
1 answer
2k views

SwiftUI - Attempted to scroll the collection view to an out-of-bounds item

My App is getting crashed immediately after navigating to the screen in iOS>16.0 devices by saying *** Assertion failure in -[_TtC7SwiftUIP33_8825076C2763A50452A210CBE1FA4AF020PagingCollectionView ...
Bhanuteja's user avatar
  • 791
2 votes
2 answers
144 views

Identify a minimum that occurs before a maximum within a rolling widow in python

I am trying to identify a minimum that occurs before a maximum that is found within a rolling window that starts on row after (yes that is convoluted but I don’t have the English to express it ...
sdp501's user avatar
  • 65
3 votes
1 answer
2k views

What is stride in c

What is 'stride' in C and how can it be used?
Sharim09's user avatar
  • 6,196
0 votes
1 answer
704 views

Python (32-bit) librosa error: ValueError: array is too big; `arr.size * arr.dtype.itemsize` is larger than the maximum possible size

I am trying to use librosa to extract audio features. I use a Raspberry Pi 4 running 32-bit RaspiOS running Python 3.8.7. When I try to run the code: import librosa import numpy as np soundddata, fs = ...
BlackOut's user avatar
0 votes
0 answers
363 views

How to set right strides in MLMultiArray in Core ML? What's the strides' values' meaning?

How to set right strides in MLMultiArray in Core ML? What's the EVERY strides' values' meaning? For example, assume a Core ML model input shape is (1, 3, 1280, 720), so how to set strides when create ...
Smeegol's user avatar
  • 2,054
0 votes
1 answer
527 views

NumPy 'as_strided' for strided sliding window over RGBA image (3D array)

I've done research and looked over several questions on SO to figure out the proper set-up of strides and shape, but it's been giving me problems. I have an image array of shape (250, 250, 4) (example)...
Jack Avante's user avatar
  • 1,523
2 votes
1 answer
1k views

python implementation of numpy.lib.stride_tricks.as_strided

I'm trying to translate the as_strided function of NumPy to a function in Python when I translate ahead the number of strides to the number of variables according to the type of the variable (for ...
Valeria Mordoh's user avatar

15 30 50 per page
1
2 3 4 5
11