class_docstr: This class tests all member functions of crypten package
class_docstr_tok: ["This","class","tests","all","member","functions","of","crypten","package"]
docstr: Test that crypten.save_from_party and crypten.load_from_party
  properly save and load plaintext modules
code: def test_plaintext_save_load_module_from_party(self) -> None:
      """Test that crypten.save_from_party and crypten.load_from_party
      properly save and load plaintext modules"""
      import tempfile
  
      comm = crypten.communicator
      for model_type in [TestModule, NestedTestModule]:
          # Create models with different parameter values on each rank
          rank = comm.get().get_rank()
  
          test_model = model_type(200, 10)
          test_model.set_all_parameters(rank)
          serial.register_safe_class(model_type)
  
          filename = tempfile.NamedTemporaryFile(delete=True).name
          for src in range(comm.get().get_world_size()):
              crypten.save_from_party(test_model, filename, src=src)
  
              result = crypten.load_from_party(filename, src=src)
              if src == rank:
                  for param in result.parameters(recurse=True):
                      self.assertTrue(
                          param.eq(rank).all().item(),
                          "Model load failed",
                      )
              self.assertEqual(result.src, src)
  
imports: import itertools
  import logging
  import math
  import random
  import unittest
  from collections import defaultdict
  import crypten
  import crypten.communicator
  import torch
  import torch.nn.functional
  from crypten.common import serial
  from crypten.common.tensor_types import is_float_tensor
  from crypten.config import cfg
  from test.multiprocess_test_case import get_random_test_tensor, MultiProcessTestCase
  from torch import nn
label_desc: Use image node_id 14 for calling the TestCrypten obj's underlying member method code with example usage: obj.test_plaintext_save_load_module_from_party() without return types