code: def hist_scaled_pt(self: Tensor, brks=None):
      # Pytorch-only version - switch to this if/when interp_1d can be optimized
      if brks is None:
          brks = self.freqhist_bins()
      brks = brks.to(self.device)
      ys = torch.linspace(0.0, 1.0, len(brks)).to(self.device)
      return (
          self.flatten()
          .interp_1d(brks, ys)
          .reshape(self.shape)
          .clamp(0.0, 1.0)
      )
  
imports: from __future__ import annotations
  from ..basics import *
  from ..vision.all import *
  from ..data.transforms import *
  import pydicom, kornia, skimage
  from pydicom.dataset import Dataset
  from pydicom.tag import BaseTag
  from pydicom.multival import MultiValue
  from PIL import Image
label_desc: Use image node_id 8 for calling a global function with example usage: hist_scaled_pt(brks) and returns: self