Skip to content

Constant folding override #2890

@srikris-sridhar

Description

@srikris-sridhar

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()

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