Skip to content

Harden TensorData validity contract #5426

Description

@laggui

TensorData documents and relies on consistency between its bytes, shape, and dtype, but its public fields and raw-byte constructors currently allow safe code to create invalid values.

  • Make TensorData fields private and expose appropriate accessors
  • Introduce fallible raw-byte constructors
  • Ensure deserialization rejects the same invalid representations as fallible raw-byte construction

Somewhat related to #5360 #5316

Activity

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

Metadata

Metadata

Assignees

Labels

enhancementEnhance existing features

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions