class_docstr: This class tests all functions of CUDALongTensor as well as its integration with MPCTensor.
class_docstr_tok: ["This","class","tests","all","functions","of","CUDALongTensor","as","well","as","its","integration","with","MPCTensor","."]
docstr: Test the forward/backward pass of MLP on GPU
code: def test_mlp(self) -> None:
      """Test the forward/backward pass of MLP on GPU"""
      model = MLP()
      dummy_input = torch.empty((32, 128))
      model = crypten.nn.from_pytorch(model, dummy_input=dummy_input)
      model = model.to(self.device)
      model.encrypt()
      model.train()
  
      rand_in = crypten.cryptensor(
          torch.rand([32, 128], device=self.device), requires_grad=True
      )
      output = model(rand_in)
  
      model.zero_grad()
      output.backward()
      model.update_parameters(learning_rate=1e-3)
  
imports: import collections
  import itertools
  import logging
  import unittest
  import crypten
  import torch
  import torch.nn
  import torch.nn.functional
  from crypten.config import cfg
  from crypten.cuda import CUDALongTensor
  from test.multiprocess_test_case import get_random_test_tensor, MultiProcessTestCase
  from test.test_mpc import TestMPC
label_desc: Use image node_id 2 for calling the TestCUDA obj's underlying member method code with example usage: obj.test_mlp() without return types