[quant] Remove warning for quantized Tensor in __dir__ (#69265)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69265

This is used in tab completion, we should not put warning here

Test Plan:
ci

Imported from OSS

Reviewed By: albanD

Differential Revision: D32778736

fbshipit-source-id: f1bec5e09a8238ab41329ac2b64e6f3267799f6a
This commit is contained in:
Jerry Zhang 2021-12-02 10:28:57 -08:00 committed by Facebook GitHub Bot
parent 17e5200441
commit 84aa1ddedd

View file

@ -700,8 +700,6 @@ class Tensor(torch._C._TensorBase):
def __dir__(self):
if has_torch_function_unary(self):
return handle_torch_function(Tensor.__dir__, (self,), self)
if self.is_quantized:
warnings.warn('Only a small subset of methods are supported for quantized tensors.')
tensor_methods = dir(self.__class__)
tensor_methods.remove('volatile') # deprecated
attrs = list(self.__dict__.keys())