Skip to content

[TORCH] Add support for aten.heaviside #4211

Open
@sharavana20

Description

@sharavana20

I would like to add support for the torch.heaviside operation in the Torch dialect of Torch-MLIR.

I tested with the torch.heaviside using fx.export_and_import and the reproduced error is

Image

Minimal Reproduction

def run(f):
    print(f"{f.__name__}")
    print("-" * len(f.__name__))
    f()
    print()

@run
def test_heaviside():
    class HeavisideModule(nn.Module):
        def __init__(self):
            super().__init__()
        def forward(self,x):
            input,values=x
            return torch.heaviside(input,values)
    
    exported=fx.export_and_import(HeavisideModule(),(torch.randn(1,2),torch.randn(1)),output_type='torch')
    print(exported)

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