code: def _softmax_backward_data(func, *args, **kwargs):
      _check_args_kwargs_length(
          args, kwargs, f"__torch_dispatch__, {func}", len_args=4
      )
      grad, output, dim, input_dtype = args
      if is_masked_tensor(grad) and is_masked_tensor(output):
          if not _masks_match(grad, output):
              raise ValueError(
                  "__torch_dispatch__, {func}: expected the masks of grad and output to match"
              )
          grad_data = _get_data(grad)
          new_grad_data = torch.ops.aten._masked_softmax_backward(
              grad_data,
              _get_data(output),
              ~_maybe_get_mask(grad),
              dim % grad_data.ndim,
          )
          res = MaskedTensor(new_grad_data, _maybe_get_mask(grad))
          return res
      else:
          raise ValueError(
              f"__torch_dispatch__, {func}: grad and output must both be MaskedTensors"
          )
  
imports: from functools import partial
  import torch
  from .binary import _apply_native_binary, NATIVE_BINARY_FNS, NATIVE_INPLACE_BINARY_FNS
  from .core import is_masked_tensor, MaskedTensor, _get_data, _masks_match, _maybe_get_mask
  from .passthrough import _apply_pass_through_fn, PASSTHROUGH_FNS
  from .reductions import _apply_reduction, NATIVE_REDUCE_FNS, TORCH_REDUCE_FNS, TENSOR_REDUCE_FNS
  from .unary import _apply_native_unary, NATIVE_UNARY_FNS, NATIVE_INPLACE_UNARY_FNS
label_desc: Use image node_id 27 for calling a global function with example usage: _softmax_backward_data(func) and returns: res