code: def test_find_shared_non_shared_tensors(self):
      A = torch.zeros((4,))
      B = A[:2]
      C = A[2:]
      # Shared storage but do not overlap
      self.assertEqual(
          _find_shared_tensors({"B": B, "C": C}), [{"B"}, {"C"}]
      )
  
      B = A[:2]
      C = A[1:]
      # Shared storage but *do* overlap
      self.assertEqual(
          _find_shared_tensors({"B": B, "C": C}), [{"B", "C"}]
      )
  
      B = A[:2]
      C = A[2:]
      D = A[:1]
      # Shared storage but *do* overlap
      self.assertEqual(
          _find_shared_tensors({"B": B, "C": C, "D": D}),
          [{"B", "D"}, {"C"}],
      )
  
imports: import copy
  import unittest
  import torch
  from safetensors import safe_open
  from safetensors.torch import _end_ptr, _find_shared_tensors, _is_complete, _remove_duplicate_names, load_model, save_file, save_model
label_desc: Use image node_id 3 for calling the TorchModelTestCase obj's underlying member method code with example usage: obj.test_find_shared_non_shared_tensors() without return types