-
Notifications
You must be signed in to change notification settings - Fork 560
Closed
Labels
dynamismDynamic Shape FeaturesDynamic Shape Features
Description
🚀 Feature
Support printing a dynamic size.
Motivation
This is a common user behavior, we need to provide some kind of output.
Pitch
I think we agreed that it should print the upper_bound but correct me if I am wrong.
Repo
PyTorch and PyTorch/XLA both at nightly.
import torch
import torch_xla.core.xla_model as xm
import os
os.environ["XLA_EXPERIMENTAL"] = "nonzero:masked_select:masked_scatter"
dev = xm.xla_device()
num_element = 10
t1 = torch.zeros([num_element], device=dev)
t1[0] = 1
t2 = torch.nonzero(t1)
print(t2.size())
error
(Pdb) print(t2.size())
*** RuntimeError: AttributeError: 'torch._C._SymNode' object has no attribute 'str'
At:
/pytorch/torch/__init__.py(238): __repr__
<stdin>(1): <module>
/root/anaconda3/envs/pytorch/lib/python3.7/pdb.py(374): default
/root/anaconda3/envs/pytorch/lib/python3.7/cmd.py(216): onecmd
/root/anaconda3/envs/pytorch/lib/python3.7/pdb.py(416): onecmd
/root/anaconda3/envs/pytorch/lib/python3.7/cmd.py(138): cmdloop
/root/anaconda3/envs/pytorch/lib/python3.7/pdb.py(319): _cmdloop
/root/anaconda3/envs/pytorch/lib/python3.7/pdb.py(350): interaction
/root/anaconda3/envs/pytorch/lib/python3.7/pdb.py(259): user_line
/root/anaconda3/envs/pytorch/lib/python3.7/bdb.py(112): dispatch_line
/root/anaconda3/envs/pytorch/lib/python3.7/bdb.py(88): trace_dispatch
test/test_dynamic_fail.py(17): <module>
Metadata
Metadata
Assignees
Labels
dynamismDynamic Shape FeaturesDynamic Shape Features