Skip to content

Fix/TopK converter 1D input support - #4637

Open
dongwoonhyun wants to merge 2 commits into
pytorch:release/2.11from
dongwoonhyun:fix/topk-1d-input
Open

Fix/TopK converter 1D input support#4637
dongwoonhyun wants to merge 2 commits into
pytorch:release/2.11from
dongwoonhyun:fix/topk-1d-input

Conversation

@dongwoonhyun

Copy link
Copy Markdown

Description

TopK's converter requires inputs to be at least 2D. This PR extends support to 1D inputs using unsqueeze -> topk -> squeeze. A regression test is also added.

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 Aug 28, 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 Aug 28, 2026
@github-actions
github-actions Bot requested a review from zewenli98 August 28, 2026 18:17
@SrivastavaKshitij

Copy link
Copy Markdown

@narendasan @apbose : for viz

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.

2 participants