jakirkham <jakirk...@gmail.com> added the comment:

The 2nd argument is the `strides`. IOW it is just specifying how to traverse 
the buffer in memory to visit each of the dimensions.

For the first example where `strides` is not specified, Python makes them 
C-ordered. IOW `m2.strides` would be `(3, 1)`. Effectively this is represented 
like this:

```
[[ b"a", b"c", b"e"],
 [ b"b", b"d', b"f"]]
```

For the second case where strides are overridden (so `m2.strides` would be `(1, 
2)`), we get something like this:

```
[[b"a", b"b", b"c"],
 [b"d", b"e", b"f"]]
```

In either case the `1` here has specified which dimension is fastest to 
traverse along. IOW that content is adjacent in memory.

Should add the reason it is `1` is that for `uint8_t` (or format "B"), this is 
that type's size. If we had a different format, this would be the size of that 
format.

HTH

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41226>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to