class_docstr: Test suite for classes defined in `transforms` module
class_docstr_tok: ["Test","suite","for","classes","defined","in","`","transforms","`","module"]
code: def assert_batch_consistency(
      self,
      transform,
      batch,
      *args,
      atol=1e-8,
      rtol=1e-5,
      seed=42,
      **kwargs,
  ):
      n = batch.size(0)
  
      # Compute items separately, then batch the result
      torch.random.manual_seed(seed)
      items_input = batch.clone()
      items_result = torch.stack(
          [transform(items_input[i], *args, **kwargs) for i in range(n)]
      )
  
      # Batch the input and run
      torch.random.manual_seed(seed)
      batch_input = batch.clone()
      batch_result = transform(batch_input, *args, **kwargs)
  
      self.assertEqual(items_input, batch_input, rtol=rtol, atol=atol)
      self.assertEqual(items_result, batch_result, rtol=rtol, atol=atol)
  
imports: import os
  import torch
  from parameterized import parameterized
  from torchaudio import transforms
  from torchaudio_unittest import common_utils
label_desc: Use image node_id 1 for calling the TestTransforms obj's underlying member method code with example usage: obj.assert_batch_consistency(transform, batch) without return types