Skip to content

[ONNX] RNN activation function exported to ONNX with wrong string case #19366

@spandantiwari

Description

@spandantiwari

🐛 Bug

If we export nn.RNN module to ONNX, the activations attribute is written is all lower case. Several backends assume these strings to be case-sensitive, where this can be a blocking issue during runtime. There is an open issue (onnx/onnx#1934) in the ONNX repo to make this this explicit in the spec. PyTorch's ONNX exporter should also consider writing strings with correct case in activations attribute.

To Reproduce

Steps to reproduce the behavior:

  1. Create a simple model with nn.RNN module.
  2. Export this model to ONNX using torch.onnx.export
  3. Check the activations attribute for the case of the string. As an example, the string will be 'tanh', where ideally it should be 'Tanh'.

Expected behavior

The activations attribute value should match the case specified in ONNX spec.

Environment

This can be seen in all environments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: onnxRelated to torch.onnxtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions