Skip to content

Rather than passing a power value of 1 to the scale op, send None.#4181

Open
SandSnip3r wants to merge 1 commit intopytorch:mainfrom
SandSnip3r:batchnorm-nan
Open

Rather than passing a power value of 1 to the scale op, send None.#4181
SandSnip3r wants to merge 1 commit intopytorch:mainfrom
SandSnip3r:batchnorm-nan

Conversation

@SandSnip3r
Copy link
Copy Markdown
Contributor

@SandSnip3r SandSnip3r commented Apr 10, 2026

Description

Rather than passing 1 for the exponent for the scale op, pass None. This will save a wasteful elementwise pow op being run.
This also prevents us from hitting a bug in TensorRT-RTX where pow(x,y) where x is negative returns NaN.

Fixes #3699

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes
  • I have added the relevant labels to my PR in so that relevant reviewers are notified

@meta-cla meta-cla bot added the cla signed label Apr 10, 2026
@github-actions github-actions bot added component: tests Issues re: Tests component: conversion Issues re: Conversion stage component: core Issues re: The core compiler component: converters Issues re: Specific op converters component: api [Python] Issues re: Python API component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Apr 10, 2026
@github-actions github-actions bot requested a review from narendasan April 10, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed component: api [Python] Issues re: Python API component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: tests Issues re: Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [Bug] TensorRT-RTX BatchNorm constant fold got nan

1 participant