Skip to content

[torch.logit] how to use one input version interface ? #4374

@vfdff

Description

@vfdff

According the torch.logit.html, the eps is optional

torch.logit(input, eps=None, *, out=None) → Tensor

but I get [error info ] (error: custom op 'torch.aten.logit' expected 2 operands) if don't input the 2nd input

func.func @torch_aten_logit_with_one_input(%arg0: !torch.vtensor<[2, 2, 8],f32>) -> !torch.vtensor<[2, 2, 8],f32>  {
  %0 = torch.aten.logit %arg0 : !torch.vtensor<[2, 2, 8],f32> -> !torch.vtensor<[2, 2, 8],f32>
  return %0 : !torch.vtensor<[2, 2, 8],f32>
} 
  • I can work around it to use explicit %none for the 2nd optional input, but indeed here input 2 inputs.
func.func @torch_aten_logit_with_one_input(%arg0: !torch.vtensor<[2, 2, 8],f32>, %arg1: !torch.none) -> !torch.vtensor<[2, 2, 8],f32> attributes {hacc.entry} {
  %none = torch.constant.none
  %0 = torch.aten.logit %arg0, %none : !torch.vtensor<[2, 2, 8],f32>, !torch.none -> !torch.vtensor<[2, 2, 8],f32>
  return %0 : !torch.vtensor<[2, 2, 8],f32>
} 

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