It seems that torch.jit.unused does not support normal object class. Is there any plans to support it? For now, the following codes will cause an error: 'torch.jit.frontend.UnsupportedNodeError: with statements aren’t supported:'
@torch.jit.script
class MyObject(object):
    def __init__(self):
        super().__init__()

    @torch.jit.unused
    def unsupported(self):
        with torch.no_grad():
            print('This is not supported by jit.')

    def supported(self, x):
        print('This is supported by jit.')

By the way, could anyone give some advices to handle this situation where classes with torchscript-unsupported attributes are used during torchscript inference process.