code: def _masked_all_dim(data, dim, keepdim=False, mask=None):
      if mask is None:
          return torch.all(data, dim=dim, keepdim=keepdim)
      return torch.all(
          data.masked_fill(~mask, True), dim=dim, keepdim=keepdim
      )
  
file_path: pytorch/torch/masked/maskedtensor/reductions.py
imports: import warnings
  import torch
  from .core import is_masked_tensor
  from .creation import as_masked_tensor, masked_tensor
label_desc: Use image node_id 2 for calling a global function with example usage: _masked_all_dim(data, dim, keepdim, mask) and returns: torch, torch