@Michael_Suo  Problem is still present:
class SomeClass(object):
    def __init__(self, x):
        # type: (int)
        self.x = x
    def some_method(self, a, b):
        # type: (Tensor, Tensor)
        assert torch.isfinite(a).all().item(), "Some of elements are infinite or NaN!"

RuntimeError: 
Tried to access nonexistent attribute or method 'all' of type 'bool'.:```