Let I have the Model and some method check_input_shape. I always want to use this method in pytorch but I want to ignore it in TorchScript. So, is there anything (maybe some decorator) to do it? I found torch.jit.unused but this decorator raise exception when trying to call decorated function
Nope, it doesnโt work. If you use the torch.jit.ignore and try to run TorchScript model you either use python interpreter (when pass argument drop=False) or raise exception (when pass argument drop=True).