File tree Expand file tree Collapse file tree 1 file changed +0
-20
lines changed
Expand file tree Collapse file tree 1 file changed +0
-20
lines changed Original file line number Diff line number Diff line change @@ -323,26 +323,6 @@ trainer = Trainer(callbacks=[checkpointing])
323323
324324</details >
325325
326- <details >
327- <summary >Export to torchscript (JIT) (production use) - DEPRECATED</summary >
328-
329- > ** ⚠️ Deprecated** : ` to_torchscript() ` is deprecated in PyTorch Lightning v2.5 and will be removed in v2.7.
330- > TorchScript is deprecated in PyTorch. Use ` torch.export.export() ` instead.
331- > See [ PyTorch Export Documentation] ( https://pytorch.org/docs/stable/export.html ) for more information.
332-
333- ``` python
334- # torchscript (deprecated)
335- autoencoder = LitAutoEncoder()
336- torch.jit.save(autoencoder.to_torchscript(), " model.pt" )
337-
338- # Recommended alternative using torch.export
339- import torch
340- autoencoder = LitAutoEncoder()
341- exported_program = torch.export.export(autoencoder, (torch.randn(1 , 64 ),))
342- torch.export.save(exported_program, " model.pt2" )
343- ```
344-
345- </details >
346326
347327<details >
348328 <summary >Export to ONNX (production use)</summary >
You can’t perform that action at this time.
0 commit comments