code: def validate_schema(schema: FunctionSchema) -> None:
      if not torch._library.utils.is_functional_schema(schema):
          raise ValueError(
              f"custom_op only supports functional operators "
              f"(ops that do not mutate any inputs, do not return "
              f"views of the inputs, and has at least one return). "
              f"Got the following non-functional schema: {schema}"
          )
  
      # For simplicity: don't allow self arguments
      if schema.arguments.self_arg is not None:
          raise ValueError(
              f"custom_op does not support arguments named 'self'. Please "
              f"rename your argument. Got: {schema}"
          )
  
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 4 for calling a global function with example usage: validate_schema(schema) without return types