Skip to content

Commit

Permalink
Fix provenance tensor to work with PyTorch 1.11 (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzo committed Mar 17, 2022
1 parent 7ea6ac5 commit 821c1b4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions funsor/torch/provenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ class ProvenanceTensor(torch.Tensor):
def __new__(cls, data, provenance=frozenset(), **kwargs):
if not provenance:
return data
instance = torch.Tensor.__new__(cls)
instance.__init__(data, provenance)
return instance
return torch.Tensor.__new__(cls)

def __init__(self, data, provenance=frozenset()):
assert isinstance(provenance, frozenset)
Expand Down

0 comments on commit 821c1b4

Please sign in to comment.