AssertionError During Quantization of torch.empty_like()
, torch.ones_like
, and torch.randn_like
#2146
Labels
torch.empty_like()
, torch.ones_like
, and torch.randn_like
#2146
🐛 Describe the bug
Similar to #146621, when quantizing a model containing a
torch.empty_like()
,torch.ones_like
, andtorch.randn_like
operations usingPT2E (prepare_pt2e)
, the process fails with an assertion error inside_maybe_insert_input_observers_for_node
. The root cause is thattorch.empty_like()
,torch.ones_like
, andtorch.randn_like
havekwargs
, but currently the code assumes that mostaten
ops (except a few listed ones) should not havekwargs
.torch.empty_like
torch.ones_like
torch.randn_like
Versions
PyTorch version: 2.7.0+cu126
Is debug build: False
CUDA used to build PyTorch: 12.6
ROCM used to build PyTorch: N/A
cc @jerryzh168 @jianyuh @raghuramank100 @jamesr66a @vkuzo @jgong5 @Xia-Weiwen @leslie-fang-intel @msaroufim
The text was updated successfully, but these errors were encountered: