code: def dropout2d(
      x: torch.Tensor,
      prob: float,
      /,
      *,
      training: bool = True,
      data_format: str = "NHWC",
      out: Optional[torch.Tensor] = None,
  ) -> torch.Tensor:
      is_batched = len(x.shape) == 4
      if data_format == "NHWC":
          perm = (0, 3, 1, 2) if is_batched else (2, 0, 1)
          x = torch.permute(x, perm)
      res = torch.nn.functional.dropout2d(x, prob, training=training)
      if data_format == "NHWC":
          perm = (0, 2, 3, 1) if is_batched else (1, 2, 0)
          res = torch.permute(res, perm)
      return res
  
imports: from typing import Optional, Union, Tuple, List, Literal, Sequence, Callable
  import torch
  import math
  import ivy
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  from .None import backend_version
  from ivy.functional.ivy.layers import _handle_padding, _get_num_padded_values, _validate_max_pool_params, _depth_max_pooling_helper
  from ivy.functional.ivy.experimental.layers import _padding_ceil_mode, _broadcast_pooling_helper
label_desc: Use image node_id 16 for calling a global function with example usage: dropout2d() and returns: res