docstr: Test that boxing with GradSampleModule won't alter any outputs.
  Gradients are tested in the various `grad_samples` tests.
docstr_tok: ["Test","that","boxing","with","GradSampleModule","wo","n't","alter","any","outputs",".","Gradients","are","tested","in","the","various","`","grad_samples","`","tests","."]
code: def test_outputs_unaltered(self):
      """
      Test that boxing with GradSampleModule won't alter any outputs.
      Gradients are tested in the various `grad_samples` tests.
      """
      x, _ = next(iter(self.dl))
      self.original_model = self.original_model.eval()
      self.grad_sample_module = self.grad_sample_module.eval()
      with torch.no_grad():
          normal_out = self.original_model(x)
          gs_out = self.grad_sample_module(x)
      msg = (
          f"GradSample L2 norm = : {gs_out.norm(2)}, ",
          f"Original L2 norm = : {normal_out.norm(2)}, ",
          f"MSE = {F.mse_loss(gs_out, normal_out)}, ",
          f"L1 Loss = {F.l1_loss(gs_out, normal_out)}",
      )
      assert_close(gs_out, normal_out, atol=1e-7, rtol=1e-5, msg=msg)
  
imports: import unittest
  import torch
  import torch.nn
  import torch.nn.functional
  from opacus.grad_sample import GradSampleModule
  from opacus.grad_sample.gsm_exp_weights import GradSampleModuleExpandedWeights
  from opacus.grad_sample.linear import compute_linear_grad_sample
  from opacus.grad_sample.utils import register_grad_sampler
  from torch.testing import assert_close
  from torch.utils.data import DataLoader
  from torchvision import transforms
  from torchvision.datasets import FakeData
  from torchvision.models import mobilenet_v3_small
label_desc: Use image node_id 3 for calling the GradSampleModuleTest obj's underlying member method code with example usage: obj.test_outputs_unaltered() without return types