code: def _box_unary_scalar(target=None):
      """Update dtype if input is float in unary operations.
  
      How it works?
      -------------
      Promotes input to tensor if not the case.
      """
  
      def _decorator(func):
          @functools.wraps(func)
          def _wrapped(x, *args, **kwargs):
              if not _torch.is_tensor(x):
                  x = _torch.tensor(x)
              return func(x, *args, **kwargs)
  
          return _wrapped
  
      if target is None:
          return _decorator
  
      return _decorator(target)
  
file_path: geomstats/geomstats/_backend/pytorch/_dtype.py
imports: import functools
  import torch
  from torch import complex64, complex128, float32, float64
  from geomstats._backend import _backend_config
  from geomstats._backend._dtype_utils import _MAP_FLOAT_TO_COMPLEX, _modify_func_default_dtype, _pre_add_default_dtype_by_casting, _pre_allow_complex_dtype, _pre_cast_out_to_input_dtype, _update_default_dtypes, get_default_cdtype, get_default_dtype
  from ._common import cast
label_desc: Use image node_id 8 for calling a global function with example usage: _box_unary_scalar(target) and returns: _decorator, _wrapped, _decorator, func