code: def register_custom_call_target(
      name: str, fn: Any, platform: str = "cpu"
  ) -> None:
      """Registers a custom call target.
  
      Args:
        name: bytes containing the name of the function.
        fn: a PyCapsule object containing the function pointer.
        platform: the target platform.
      """
      # To support AMD GPUs, we need to have xla_platform_names["gpu"] == "ROCM"
      # Since that is hardcoded to CUDA, we are using the following as workaround.
      xla_platform_name = xla_platform_names.get(platform, platform)
      with _custom_callback_lock:
          if xla_platform_name in _custom_callback_handler:
              _custom_callback_handler[xla_platform_name](
                  name, fn, xla_platform_name
              )
          else:
              _custom_callback.setdefault(xla_platform_name, []).append(
                  (name, fn)
              )
  
imports: from __future__ import annotations
  import atexit
  import contextlib
  import enum
  import gzip
  import inspect
  import logging
  import os
  import threading
  from typing import Any, List, Mapping, Optional, Sequence, Tuple, Union
  import ml_dtypes
  import numpy
  from .None import xla_extension
label_desc: Use image node_id 20 for calling a global function with example usage: register_custom_call_target(name, fn, platform) without return types