Skip to content

[TORCH] Add support for aten.heaviside #4211

@sharavana20

Description

@sharavana20
Contributor

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @sharavana20

      Issue actions

        [TORCH] Add support for aten.heaviside · Issue #4211 · llvm/torch-mlir