Skip to content

LightningModule.to_torchscript() does not transfer check_inputs to correct device #18824

@pfeatherstone

Description

@pfeatherstone

Bug description

When running LightningModule.to_torchscript() you can pass both example_inputs and check_inputs. example_inputs gets transferred to the correct device. check_inputs does not.

What version are you seeing the problem on?

v2.0

How to reproduce the bug

No response

Error messages and logs

# Error messages and logs here please

Environment

Current environment
#- Lightning Component (e.g. Trainer, LightningModule, LightningApp, LightningWork, LightningFlow):
#- PyTorch Lightning Version (e.g., 1.5.0):
#- Lightning App Version (e.g., 0.5.2):
#- PyTorch Version (e.g., 2.0):
#- Python version (e.g., 3.9):
#- OS (e.g., Linux):
#- CUDA/cuDNN version:
#- GPU models and configuration:
#- How you installed Lightning(`conda`, `pip`, source):
#- Running environment of LightningApp (e.g. local, cloud):

More info

No response

cc @Borda

Metadata

Metadata

Labels

bugSomething isn't workinggood first issueGood for newcomersrepro neededThe issue is missing a reproducible examplever: 2.0.x

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions