Skip to content

ONNX export may fail for Hiera due to math.sqrt and python type int casts #33181

@xenova

Description

@xenova

Similar to a previous issue (#31311) we had with vision models. cc @merveenoyan @amyeroberts @NielsRogge

Offending lines:

pos_embeds = pos_embeds.reshape(1, int(math.sqrt(num_positions)), int(math.sqrt(num_positions)), dim)

scale_factor=(h0 / math.sqrt(num_positions), w0 / math.sqrt(num_positions)),

We should probably abstract interpolate_pos_encoding, since this is reused across many different vision architectures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions