How to delete nodes in torchsctipt using pytorch

How to delete nodes in torchsctipt using pytorch?

Is there an interface that can be called?

No, I’m not aware of an interface to manipulate the TorchScript graph, but also note that TorchScript is in maintenance mode and the currently recommended approach is to use torch.compile.