Skip to content

LayerNormalization shape check error #25896

@yuanyao-nv

Description

@yuanyao-nv

For the following LayerNormalization node,

Image

there seems to be a regression since v1.21 where it complains

Status Message: Size of X.shape[axis:] must be larger than 1, got 1

Granted, computing LayerNorm on just 1 value is pointless since the standard deviation become 0+eps and you're essentially rescaling by 1/sqrt(eps), but it should still be a valid computation and the ONNX spec does not forbit it. Imposing this additional constraint in onnxruntime causes some older models to fail on this. Any thoughts?

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