code: def test_percent_element(
      tensor, unused1, unused2, unused3, dim, percent, k
  ):
      """Tests whether comparative values for top_k_element and top_k_percent returns same outputs"""
      sparser_2d = SignalSparsity(
          sst_top_k_percent=None,
          sst_top_k_element=k,
          sst_top_k_dim=dim,
          dst_top_k_percent=100,
      )
      sst_element = sparser_2d.dense_to_sst(tensor)
  
      sparser_2d = SignalSparsity(
          sst_top_k_percent=percent,
          sst_top_k_element=None,
          sst_top_k_dim=dim,
          dst_top_k_percent=100,
      )
      sst_percent = sparser_2d.dense_to_sst(tensor)
      objects_are_equal(
          sst_element,
          sst_percent,
          raise_exception=True,
          rtol=RTOL,
          atol=ATOL,
      )
  
file_path: fairscale/tests/experimental/wgit/test_signal_sparsity.py
imports: import pytest
  import torch
  from fairscale.experimental.wgit.signal_sparsity import SignalSparsity, random_sparse_mask
  from fairscale.fair_dev.testing.testing import objects_are_equal
label_desc: Use image node_id 7 for calling a global function with example usage: test_percent_element(tensor, unused1, unused2, unused3, dim, percent, k) without return types