code: def dropout(
      x,
      p=0.5,
      axis=None,
      training=True,
      mode="upscale_in_train",
      name=None,
  ):
      if axis is not None and axis > 1:
          raise ValueError("Axis value can only be 0 or 1 or None.")
      elif axis is None or (isinstance(axis, list) and len(axis) == 2):
          mask = get_mask(
              shape=x.shape, device=ivy.dev(x), prob=p, seed=None
          )
      elif axis == 0:
          mask = get_mask(
              shape=(x.shape[0], 1), device=ivy.dev(x), prob=p
          )
          mask = ivy.broadcast_to(mask, x.shape)
      elif axis == 1:
          mask = get_mask(
              shape=(1, x.shape[1]), device=ivy.dev(x), prob=p
          )
          mask = ivy.broadcast_to(mask, x.shape)
      if mode == "upscale_in_train":
          if training:
              out = ivy.multiply(x, mask)
              ret = ivy.multiply(out, 1.0 / (1.0 - p))
          else:
              ret = x
      else:
          if training:
              ret = ivy.multiply(x, mask)
          else:
              ret = ivy.multiply(x, (1.0 - p))
      return ret
  
file_path: ivy/ivy/functional/frontends/paddle/nn/functional/common.py
imports: import ivy
  from ivy.func_wrapper import with_supported_dtypes
  from ivy.functional.frontends.paddle.func_wrapper import to_ivy_arrays_and_back
label_desc: Use image node_id 2 for calling a global function with example usage: dropout(x, p, axis, training, mode, name) and returns: ret