Skip to content

torch.ops.aten.rand_like ONNX export failure #3002

Description

Follow-up of #2993

Reproducible Example

import torch
import pytest


@pytest.mark.parametrize(
    "op", [
        torch.ops.aten.rand_like,
        torch.ops.aten.randint_like,
        torch.ops.aten.randn_like,
    ]
)
def test_x_like(op: torch._ops.OpOverloadPacket):
    class Model(torch.nn.Module):
        def forward(self, x):
            return op(x, memory_format=torch.preserve_format)

    torch.onnx.export(
        Model(),
        (torch.randn(10, 10),),
        "{op.__name__}.onnx",
        input_names=["input"],
        output_names=["output"],
        dynamo=True,
    )


if __name__ == "__main__":
    pytest.main([__file__])

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