code: def _inplace_wrapper(fn):
      """
      Given a nn.functional non-linearity, implements its `inplace: bool` argument
      """
  
      # nb. We use the name of the first argument used in the unary references
      @wraps(fn)
      def _fn(a, *args, inplace=False, **kwargs):
          if inplace:
              torch._check(
                  "out" not in kwargs,
                  lambda: "Cannot set inplace=True and pass out= at the same time",
              )
              return fn(a, *args, inplace=False, out=a, **kwargs)
          else:
              return fn(a, *args, inplace=False, **kwargs)
  
      return _fn
  
imports: import math
  from functools import wraps
  from typing import Callable, Optional, Union
  import torch
  import torch._prims
  import torch._prims_common
  import torch._refs
  from torch._decomp import register_decomposition
  from torch._prims_common import ELEMENTWISE_TYPE_PROMOTION_KIND, NumberType, ShapeType, TensorLike, TensorLikeType
  from torch._prims_common.wrappers import elementwise_type_promotion_wrapper, elementwise_unary_scalar_wrapper, out_wrapper
  from torch._refs import _make_inplace
label_desc: Use image node_id 3 for calling a global function with example usage: _inplace_wrapper(fn) and returns: _fn, fn, fn