pytorch/xla

torch_xla scan forces inputs to be differentiable

Open

#8,783 创建于 2025年3月4日

在 GitHub 查看
 (1 评论) (0 反应) (1 负责人)C++ (575 fork)github user discovery
buggood first issue

仓库指标

Star
 (2,786 star)
PR 合并指标
 (PR 指标待抓取)

描述

The snippet https://github.com/pytorch/xla/blob/00fac787e986a51e1d5d8b74603867cea4086477/torch_xla/experimental/scan.py#L217-L226 is probably wrong. It adds require_grads=True on all carry inputs and that won't work if one of the carry is a LongTensor.

The most obvious example is that if one of the input is an integer, then it can't possibly have gradients.

贡献者指南