code: def test_scale_channel():
      """Make sure that _scale_channel gives the same results on CPU and GPU as
      histc or bincount are used depending on the device.
      """
      # TODO: when # https://github.com/pytorch/pytorch/issues/53194 is fixed,
      # only use bincount and remove that test.
      size = (1_000,)
      img_chan = torch.randint(0, 256, size=size).to("cpu")
      scaled_cpu = F_t._scale_channel(img_chan)
      scaled_cuda = F_t._scale_channel(img_chan.to("cuda"))
      assert_equal(scaled_cpu, scaled_cuda.to("cpu"))
  
imports: import colorsys
  import itertools
  import math
  import os
  from functools import partial
  from typing import Sequence
  import numpy
  import PIL.Image
  import pytest
  import torch
  import torchvision.transforms
  import torchvision.transforms._functional_pil
  import torchvision.transforms._functional_tensor
  import torchvision.transforms.functional
  from common_utils import _assert_approx_equal_tensor_to_pil, _assert_equal_tensor_to_pil, _create_data, _create_data_batch, _test_fn_on_batch, assert_equal, cpu_and_cuda, needs_cuda
  from torchvision.transforms import InterpolationMode
label_desc: Use image node_id 2 for calling a global function with example usage: test_scale_channel() without return types