From 2fa4db3577e19e504036842bbdb912267c22f4af Mon Sep 17 00:00:00 2001 From: "Thomas J. Fan" Date: Tue, 31 Oct 2023 16:22:13 -0400 Subject: [PATCH] Move dataclass import to code block Signed-off-by: Thomas J. Fan --- examples/data_types_and_io/data_types_and_io/pytorch_types.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/data_types_and_io/data_types_and_io/pytorch_types.py b/examples/data_types_and_io/data_types_and_io/pytorch_types.py index a3cd61180..3a034e73b 100644 --- a/examples/data_types_and_io/data_types_and_io/pytorch_types.py +++ b/examples/data_types_and_io/data_types_and_io/pytorch_types.py @@ -73,7 +73,6 @@ def pytorch_native_wf(): # %% [markdown] # Passing around tensors and modules is no more a hassle! -from dataclasses import dataclass # %% [markdown] # ## Checkpoint @@ -85,6 +84,8 @@ def pytorch_native_wf(): # As per PyTorch [docs](https://pytorch.org/tutorials/beginner/saving_loading_models.html#save-load-entire-model), it is recommended to # store the module's `state_dict` rather than the module itself. However, the serialization should work either way. # %% +from dataclasses import dataclass + import torch.nn as nn import torch.nn.functional as F import torch.optim as optim