Can a pl.LightningModule be used from native pytorch? #6953
Answered
by
carmocca
turian
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
-
Can a pl.LightningModule be used from native pytorch? We are writing a library, and the use of pl.LightningModule for our modules is convenient, particularly because each module knows its device. However, our clients might be using native pytorch, and want to include our LightningModule as an nn.Module in their code. FWIW, our LightningModule currently is used purely for forward inference and currently passes no gradients, nor is it trainable.
|
Beta Was this translation helpful? Give feedback.
Answered by
carmocca
Apr 15, 2021
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
edenlightning
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nn.Module
, it actually subclasses it. If you find any, you can assume it's a bug so feel free to open issues about any pitfalls found.LightningModule
you value the most. The benefits left would be mainly organization and such.