llvm / llvm/torch-mlir

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

Open
#4,374 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.9k
Forks
736
Avg merge
5d 22h
Merged PRs (30d)
15

Description

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>
} 

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the torch.aten.logit operation from the supplied IR examples and inspect how its optional eps operand is represented. Verify the documented one-input form and the explicit !torch.none form against the operation's existing tests or validation path; done means both forms are handled consistently.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.