Hi
You can export custom methods with TorchScript. So, I would make your model to have a “extract_features” method that extracts them y mark it as @jit.export . So, you can call model.extract_features((x).