code: def _compute_coords(coords, z_scale, out, patch):
      """sliding window batch spatial scaling indexing for multi-resolution outputs."""
      for original_idx, p in zip(coords, patch):
          idx_zm = list(
              original_idx
          )  # 4D for 2D image, 5D for 3D image
          if z_scale:
              for axis in range(2, len(idx_zm)):
                  idx_zm[axis] = slice(
                      int(original_idx[axis].start * z_scale[axis - 2]),
                      int(original_idx[axis].stop * z_scale[axis - 2]),
                  )
          out[idx_zm] += p
  
file_path: MONAI/monai/inferers/utils.py
imports: from __future__ import annotations
  import itertools
  from collections.abc import Callable, Mapping, Sequence
  from typing import Any, Iterable
  import numpy
  import torch
  import torch.nn.functional
  from monai.data.meta_tensor import MetaTensor
  from monai.data.utils import compute_importance_map, dense_patch_slices, get_valid_patch_size
  from monai.utils import BlendMode, PytorchPadMode, convert_data_type, convert_to_dst_type, ensure_tuple, ensure_tuple_rep, fall_back_tuple, look_up_option, optional_import, pytorch_after
label_desc: Use image node_id 3 for calling a global function with example usage: _compute_coords(coords, z_scale, out, patch) without return types