Skip to content

Pad operator algorithm steps should not throw error for scalar input #893

@huningxin

Description

@huningxin

@fdwr raised this issue when reviewing Chromium CL https://chromium-review.googlesource.com/c/chromium/src/+/6972256/comment/7552dd15_61137e37/

The WebNN spec says in the table that ranks 0 to N are allowed for pad's input, including scalars which is mathematically reasonable (given beginningPadding and endingPadding are both empty to satisfy the rule that they have the same size as the input rank) and also consistent with tile and transpose as nops, and you even have an implementation of it below. Though, currently one of the algorithm steps say "If input’s rank is 0, then throw a TypeError", and so I'd be happy to update the spec to remove that 1 line in the algorithm steps.

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