Thanks for your time!
I made it works with something like this:
class Interpolate(torch.jit.ScriptModule):
    __constants__ = ["scale_factor", "mode", "align_corners"]

    def __init__(self, scale_factor=2.0, mode="nearest", align_corners=None):
        super(Interpolate, self).__init__()
        self.scale_factor = scale_factor
        self.mode = mode
        self.align_corners = align_corners

    @torch.jit.script_method
    def forward(self, X):
        return nn.functional.interpolate(X, scale_factor=self.scale_factor,
                                         mode=self.mode, align_corners=self.align_corners)

I finally get the desired output:
Shape  5, torch.Size([1, 1, 10, 10, 10]) ||| torch.Size([1, 1, 10, 10, 10])
Shape 10, torch.Size([1, 1, 20, 20, 20]) ||| torch.Size([1, 1, 20, 20, 20])
Shape 15, torch.Size([1, 1, 30, 30, 30]) ||| torch.Size([1, 1, 30, 30, 30])
True
True
True