Skip to content

Add RECIPROCAL pointwise op support#303

Open
rsuderman wants to merge 1 commit intoiree-org:mainfrom
rsuderman:pointwise_reciprocal
Open

Add RECIPROCAL pointwise op support#303
rsuderman wants to merge 1 commit intoiree-org:mainfrom
rsuderman:pointwise_reciprocal

Conversation

@rsuderman
Copy link
Copy Markdown
Contributor

No description provided.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Rob Suderman <rob.suderman@gmail.com>
@rsuderman rsuderman requested a review from sjain-stanford April 3, 2026 22:53
Copy link
Copy Markdown
Member

@sjain-stanford sjain-stanford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RECIPROCAL is registered as arity-1 and has a lit test, but is NOT added to the pointwise_unary_ops.cpp GENERATE list or its switch statement. Every other non-boolean unary op PR (NEG, FLOOR, EXP, LOG, ERF, ELU_FWD) correctly adds to this sample test. This appears to be an oversight.

Fix: Add PointwiseAttr::Mode::RECIPROCAL to the GENERATE list and add:

case PointwiseAttr::Mode::RECIPROCAL: {
  double xD = static_cast<double>(x);
  y = 1.0 / xD;
  break;
}

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants