Skip to content

Constant folding override #2890

Description

Issue around constant folding when working with views that share memory. I have a fix in the local branch. Will put up a PR shortly.

    # Ensure we copy the array to avoid BufferError when numpy operations
    # (like split) create views that share memory with original tensors
    if isinstance(array, np.ndarray) and not array.flags["OWNDATA"]:
        array = array.copy()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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