Skip to content

Restrict dimensions size to [0, INT32_MAX] #734

@philloooo

Description

@philloooo

Currently we use uint32 for dimensions, so the range is [0, UINT32_MAX].

Both CoreML and tflite backends actually use int32_t for dimensions, so the range can't exceed INT32_MAX, meaning if we pass dimensions that's between INT32_MAX and UINT32_MAX they faill on these backends.

We changed from int32 to uint32 to add the non-negative constraint, but it gaves an extra bit for the dimensions range that's not supported for two of the backends.

How can we make this better?

option 1 - change back to int32

Specifies in spec validation steps that they should be non negative.

option 2 - keep uint32

Specifies in spec validation steps that they can't exceed INT32_MAX

thoughts? @huningxin @fdwr @inexorabletash

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions