code: def test_deepcopy(tensor_type, device):
      import copy
  
      N, C, H, W = 8, 2, 64, 64
      dtype = torch.float32
      sparsity = 0.8
  
      shape0 = (N, C, H, W)
      if tensor_type != BlockSparseTensor:
          shape0 = shape0[1:]
  
      a_sparse = _create_tensor(
          tensor_type,
          device,
          dtype=dtype,
          shape=shape0,
          sparsity=sparsity,
      )
  
      b_sparse = copy.deepcopy(a_sparse)
      assert torch.equal(a_sparse, b_sparse)
  
file_path: xformers/tests/test_sparse_tensors.py
imports: import pytest
  import torch
  import xformers
  from xformers.ops import masked_matmul
  from xformers.sparse import BlockSparseTensor, SparseCSRTensor
label_desc: Use image node_id 10 for calling a global function with example usage: test_deepcopy(tensor_type, device) without return types