class_docstr: Class for custom operators in PyTorch.
  
  Use the CustomOp API to create user-defined custom operators that behave
  just like regular PyTorch operators (e.g. torch.sin, torch.mm) when it
  comes to various PyTorch subsystems (like torch.compile).
  
  To construct a `CustomOp`, use `custom_op`.
code: def _register_impl(self, kind, func, stacklevel=2):
      if self._has_impl(kind):
          func_and_location = self._impls[kind]
          assert func_and_location is not None  # Pacify mypy
          location = func_and_location.location
          raise RuntimeError(
              f"Attempting to register a {kind} impl for operator {self._qualname} "
              f"that already has a {kind} impl registered from Python at "
              f"{location}. This is not supported."
          )
      frame = inspect.getframeinfo(sys._getframe(stacklevel))
      location = f"{frame.filename}:{frame.lineno}"
      self._impls[kind] = FuncAndLocation(func, location)
  
imports: import dataclasses
  import functools
  import inspect
  import sys
  import typing
  import weakref
  from torchgen.model import FunctionSchema, OperatorName, SchemaKind, BaseType, ListType, BaseTy
  import torch
  import torch._C
  import torch.library
  from torch._library.abstract_impl import AbstractImplCtx
  from torch.library import get_ctx
  from .autograd import autograd_kernel_indirection, construct_autograd_kernel
label_desc: Use image node_id 3 for calling the CustomOp obj's underlying member method code with example usage: obj._register_impl(kind, func, stacklevel) without return types