class_docstr: A GPU-backed scalar object with NumPy scalar like properties
  May be used in binary operations against other scalars, cuDF
  Series, DataFrame, and Index objects.
  
  Examples
  --------
  >>> import cudf
  >>> cudf.Scalar(42, dtype='int64')
  Scalar(42, dtype=int64)
  >>> cudf.Scalar(42, dtype='int32') + cudf.Scalar(42, dtype='float64')
  Scalar(84.0, dtype=float64)
  >>> cudf.Scalar(42, dtype='int64') + np.int8(21)
  Scalar(63, dtype=int64)
  >>> x = cudf.Scalar(42, dtype='datetime64[s]')
  >>> y = cudf.Scalar(21, dtype='timedelta64[ns]')
  >>> x - y
  Scalar(1970-01-01T00:00:41.999999979, dtype=datetime64[ns])
  >>> cudf.Series([1,2,3]) + cudf.Scalar(1)
  0    2
  1    3
  2    4
  dtype: int64
  >>> df = cudf.DataFrame({'a':[1,2,3], 'b':[4.5, 5.5, 6.5]})
  >>> slr = cudf.Scalar(10, dtype='uint8')
  >>> df - slr
     a    b
  0 -9 -5.5
  1 -8 -4.5
  2 -7 -3.5
  
  Parameters
  ----------
  value : Python Scalar, NumPy Scalar, or cuDF Scalar
      The scalar value to be converted to a GPU backed scalar object
  dtype : np.dtype or string specifier
      The data type
class_docstr_tok: ["A","GPU-backed","scalar","object","with","NumPy","scalar","like","properties","May","be","used","in","binary","operations","against","other","scalars",",","cuDF","Series",",","DataFrame",",","and","Index","objects",".","Examples","--","--","--","--",">",">",">","import","cudf",">",">",">","cudf.Scalar","(","42",",","dtype='int64","'",")","Scalar","(","42",",","dtype=int64",")",">",">",">","cudf.Scalar","(","42",",","dtype='int32","'",")","+","cudf.Scalar","(","42",",","dtype='float64","'",")","Scalar","(","84.0",",","dtype=float64",")",">",">",">","cudf.Scalar","(","42",",","dtype='int64","'",")","+","np.int8","(","21",")","Scalar","(","63",",","dtype=int64",")",">",">",">","x","=","cudf.Scalar","(","42",",","dtype='datetime64","[","s","]","'",")",">",">",">","y","=","cudf.Scalar","(","21",",","dtype='timedelta64","[","ns","]","'",")",">",">",">","x","-","y","Scalar","(","1970-01-01T00:00:41.999999979",",","dtype=datetime64","[","ns","]",")",">",">",">","cudf.Series","(","[","1,2,3","]",")","+","cudf.Scalar","(","1",")","0","2","1","3","2","4","dtype",":","int64",">",">",">","df","=","cudf.DataFrame","(","{","'","a","'",":","[","1,2,3","]",",","'","b","'",":","[","4.5",",","5.5",",","6.5","]","}",")",">",">",">","slr","=","cudf.Scalar","(","10",",","dtype='uint8","'",")",">",">",">","df","-","slr","a","b","0","-9","-5.5","1","-8","-4.5","2","-7","-3.5","Parameters","--","--","--","--","--","value",":","Python","Scalar",",","NumPy","Scalar",",","or","cuDF","Scalar","The","scalar","value","to","be","converted","to","a","GPU","backed","scalar","object","dtype",":","np.dtype","or","string","specifier","The","data","type"]
docstr: If the cache is not synched, copy either the device or host value
  to the host or device respectively. If cache is valid, do nothing
docstr_tok: ["If","the","cache","is","not","synched",",","copy","either","the","device","or","host","value","to","the","host","or","device","respectively",".","If","cache","is","valid",",","do","nothing"]
code: def _sync(self):
      """
      If the cache is not synched, copy either the device or host value
      to the host or device respectively. If cache is valid, do nothing
      """
      if self._is_host_value_current and self._is_device_value_current:
          return
      elif (
          self._is_host_value_current
          and not self._is_device_value_current
      ):
          self._device_value = cudf._lib.scalar.DeviceScalar(
              self._host_value, self._host_dtype
          )
      elif (
          self._is_device_value_current
          and not self._is_host_value_current
      ):
          self._host_value = self._device_value.value
          self._host_dtype = self._host_value.dtype
      else:
          raise ValueError("Invalid cudf.Scalar")
  
imports: import decimal
  import operator
  from collections import OrderedDict
  import numpy
  import pyarrow
  import cudf
  from cudf.api.types import is_datetime64_dtype, is_scalar, is_timedelta64_dtype
  from cudf.core.dtypes import ListDtype, StructDtype
  from cudf.core.missing import NA, NaT
  from cudf.core.mixins import BinaryOperand
  from cudf.utils.dtypes import get_allowed_combinations_for_operator, to_cudf_compatible_scalar
label_desc: Use image node_id 11 for calling the Scalar obj's underlying member method code with example usage: obj._sync() without return types