Skip to content

Commit f80a466

Browse files
authored
Skip extracting meta tensor info for sparse tensors (#676)
* Skip extracting meta tensor info for sparse tensors * Change expected failures
1 parent ecb9c3c commit f80a466

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

functorch/_src/python_key.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ def __new__(cls, elem, proxy):
5757

5858
r = torch.Tensor._make_subclass(cls, elem, elem.requires_grad)
5959
r.proxy = proxy
60-
proxy.node.meta['tensor_meta'] = _extract_tensor_metadata(r)
60+
if not elem.is_sparse:
61+
proxy.node.meta['tensor_meta'] = _extract_tensor_metadata(r)
6162
return r
6263

6364
def __repr__(self):

test/test_pythonkey.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ def f(x):
190190

191191

192192
make_fx_failures = {
193-
xfail('to_sparse'),
194193
xfail('allclose'),
195194
xfail('nn.functional.dropout'),
196195
xfail('linalg.eigvals'),

0 commit comments

Comments
 (0)