code: def test_mapping(dim, Map):
      f = Map(dim=dim, k=3)
      x = torch.randn(3, 4, 5, requires_grad=True, dtype=torch.float64)
      gradcheck(f, (x,))
  
imports: import pytest
  import torch
  from torch.autograd import gradcheck
  from ludwig.utils.entmax.activations import _entmax_threshold_and_support, _sparsemax_threshold_and_support, Entmax15, Sparsemax
label_desc: Use image node_id 1 for calling a global function with example usage: test_mapping(dim, Map) without return types