pytorch-labs/torchfix

Missing imports of the form import module.deprecated_func as yy

ZainRizvi opened this issue · 2 comments

When deprecated functions are invoked using the format import some_module.deprecated_func as yy torchfix does not catch the failure

Specifically, this line should trigger a torchfix error, but it does not:

import torch.utils._pytree._register_pytree_node as yy
yy()

Hm, you can not do import torch.utils._pytree._register_pytree_node as yy :

ModuleNotFoundError: No module named 'torch.utils._pytree._register_pytree_node'; 'torch.utils._pytree' is not a package

Ah, right. Makes sense