Closed
Description
Description
If you call .item()
(or inadvertently call .item()
) in torch, vmap will fail. This means supporting things like scalarloop are difficult when having anything vmap
for i in steps: <--- this calls .item()
The error in question
RuntimeError: vmap: It looks like you're calling .item() on a Tensor. We don't support vmap over calling .item() on a Tensor, please try to rewrite what you're doing with other operations. If error is occurring somewhere inside PyTorch internals, please file a bug report.
pytorch documentation: https://pytorch.org/functorch/stable/ux_limitations.html#data-dependent-operations-item
Metadata
Metadata
Assignees
Labels
No labels