Skip to content

Argmax of tensor that requires grad fails #1585

@mruberry

Description

@mruberry

🐛 Bug

device = xm.xla_device()
results = torch.randn((20, 20), requires_grad=True).to(device)
torch.argmax(results, 1)

RuntimeError: max(): functions with out=... arguments don't support automatic differentiation, but one of the arguments requires grad.

This does not reproduce with CPU or CUDA. You can quickly reproduce it on Colab.

Metadata

Metadata

Assignees

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