code: def default_normalizer(x: NdarrayTensor) -> NdarrayTensor:
      """
      A linear intensity scaling by mapping the (min, max) to (1, 0).
      If the input data is PyTorch Tensor, the output data will be Tensor on the same device,
      otherwise, output data will be numpy array.
  
      Note: This will flip magnitudes (i.e., smallest will become biggest and vice versa).
      """
  
      def _compute(data: np.ndarray) -> np.ndarray:
          scaler = ScaleIntensity(minv=1.0, maxv=0.0)
          return np.stack([scaler(i) for i in data], axis=0)
  
      if isinstance(x, torch.Tensor):
          return torch.as_tensor(_compute(x.detach().cpu().numpy()), device=x.device)  # type: ignore
  
      return _compute(x)
  
imports: from __future__ import annotations
  import warnings
  from collections.abc import Callable, Sequence
  from typing import cast
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from monai.config import NdarrayTensor
  from monai.transforms import ScaleIntensity
  from monai.utils import ensure_tuple, pytorch_after
  from monai.visualize.visualizer import default_upsampler
label_desc: Use image node_id 1 for calling a global function with example usage: default_normalizer(x) and returns: _compute, np, torch