Replace mentions of `.type_as()` in our docs
See original GitHub issue📚 Documentation
As a follow up to #2585, we should consider removing mentions of the .type_as() syntax in our docs and replace it with best practices for device placement and type conversion.
If you enjoy Lightning, check out our other projects! ⚡
-
Metrics: Machine learning metrics for distributed, scalable PyTorch applications.
-
Lite: enables pure PyTorch users to scale their existing code on any kind of device while retaining full control over their own loops and optimization logic.
-
Flash: The fastest way to get a Lightning baseline! A collection of tasks for fast prototyping, baselining, fine-tuning, and solving problems with deep learning.
-
Bolts: Pretrained SOTA Deep Learning models, callbacks, and more for research and production with PyTorch Lightning and PyTorch.
-
Lightning Transformers: Flexible interface for high-performance research using SOTA Transformers leveraging PyTorch Lightning, Transformers, and Hydra.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)

Top Related StackOverflow Question
Tensor.tocan be used as a safe replacement fortype_as. It also accepts another tensor as input.From the documentation:
For me, I often use the following methods