code: def test_normalize_tensor(self):
      feature_extractor = ImageFeatureExtractionMixin()
      tensor = torch.rand(16, 32, 3)
      mean = [0.1, 0.5, 0.9]
      std = [0.2, 0.4, 0.6]
  
      # mean and std can be passed as lists or tensors.
      expected = (tensor - torch.tensor(mean)) / torch.tensor(std)
      normalized_tensor = feature_extractor.normalize(tensor, mean, std)
      self.assertTrue(torch.equal(normalized_tensor, expected))
  
      normalized_tensor = feature_extractor.normalize(
          tensor, torch.tensor(mean), torch.tensor(std)
      )
      self.assertTrue(torch.equal(normalized_tensor, expected))
  
      # Normalize will detect automatically if channel first or channel last is used.
      tensor = torch.rand(3, 16, 32)
      expected = (
          tensor - torch.tensor(mean)[:, None, None]
      ) / torch.tensor(std)[:, None, None]
      normalized_tensor = feature_extractor.normalize(tensor, mean, std)
      self.assertTrue(torch.equal(normalized_tensor, expected))
  
      normalized_tensor = feature_extractor.normalize(
          tensor, torch.tensor(mean), torch.tensor(std)
      )
      self.assertTrue(torch.equal(normalized_tensor, expected))
  
imports: import unittest
  import datasets
  import numpy
  import pytest
  from transformers import is_torch_available, is_vision_available
  from transformers.image_utils import ChannelDimension, get_channel_dimension_axis
  from transformers.testing_utils import require_torch, require_vision
label_desc: Use image node_id 12 for calling the ImageFeatureExtractionTester obj's underlying member method code with example usage: obj.test_normalize_tensor() without return types