Skip to content

"undefined Tensor" error in backward #11800

@apaszke

Description

@apaszke

Apparently some of our ops might return undefined tensors in backward.

This script fails with:

Traceback (most recent call last):                                                
  File "tmp.py", line 63, in <module>                                             
    loss.backward()                                                               
  File "/scratch/apaszke/pytorch/torch/tensor.py", line 96, in backward           
    torch.autograd.backward(self, gradient, retain_graph, create_graph)           
  File "/scratch/apaszke/pytorch/torch/autograd/__init__.py", line 90, in backward
    allow_unreachable=True)  # allow_unreachable flag                             
RuntimeError: undefined Tensor                                                    

Metadata

Metadata

Assignees

No one assigned

    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