Replace methods

Hey all, is it possible to overwrite methods in a torchscript module? Use case is, to replace a buggy permute function on mps device with its cpu equivalent during runtime.