Skip to content

strides wrong for dimension = 1 objects with relaxed strides #4091

@juliantaylor

Description

@juliantaylor

if compiled with NPY_RELAXED_STRIDES_CHECKING=1

>>> x =np.array ((1,))
>>> print x.strides
(9223372036854775807,)

it goes into thise code in numpy/core/src/multiarray/ctors.c:3739

#if NPY_RELAXED_STRIDES_CHECKING
            else {
                not_cf_contig = 0; 
            }
            if (dims[i] == 1) { 
                /* For testing purpose only */
                strides[i] = NPY_MAX_INTP;
            }
#endif /* NPY_RELAXED_STRIDES_CHECKING */

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions