code: def put_along_axis(
      arr: torch.Tensor,
      indices: torch.Tensor,
      values: Union[int, torch.Tensor],
      axis: int,
      /,
      *,
      mode: Literal["sum", "min", "max", "mul", "replace"] = "replace",
      out: Optional[torch.Tensor] = None,
  ) -> torch.Tensor:
      mode_mappings = {
          "sum": "sum",
          "min": "amin",
          "max": "amax",
          "mul": "prod",
          "replace": "replace",
      }
      mode = mode_mappings.get(mode, mode)
      indices = indices.to(torch.int64)
      if mode == "replace":
          return torch.scatter(arr, axis, indices, values, out=out)
      else:
          return torch.scatter_reduce(
              arr, axis, indices, values, reduce=mode, out=out
          )
  
imports: from typing import Iterable, Optional, Union, Sequence, Tuple, NamedTuple, List, Literal, Callable, Any
  from numbers import Number
  from collections import namedtuple
  import torch
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  from ..None import backend_version
  import ivy
  from ivy.functional.ivy.experimental.manipulation import _to_tf_padding, _check_paddle_pad, _to_paddle_padding
label_desc: Use image node_id 25 for calling a global function with example usage: put_along_axis() and returns: torch, torch