class_docstr: Wrapper around cupy.ndarray
  Supports cupy.ndarray.__init__ as well as,
  gets initialized with a cupy ndarray.
docstr: Args:
      _initial_array (None, cp.ndarray/np.ndarray(including variants)):
          If _initial_array is None, object is not initialized.
          Otherwise, _initial_array (ndarray) would be set to
          _cupy_array and/or _numpy_array depending upon _supports_cupy.
      _supports_cupy (bool): If _supports_cupy is True, _initial_array
          is set as _cupy_array and _numpy_array.
          Otherwise, _initial_array is set as only _numpy_array.
  
  Attributes:
      _cupy_array (None or cp.ndarray): ndarray fully compatible with
          CuPy. This will be always set to a ndarray in GPU.
      _numpy_array (None or np.ndarray(including variants)): ndarray not
          supported by CuPy. Such as np.ndarray (where dtype is not in
          '?bhilqBHILQefdFD') and it's variants. This will be always set
          to a ndarray in CPU.
      _supports_cupy (bool): If _supports_cupy is True, data of array
          will contain in _cupy_array and _numpy_array.
          Else only _numpy_array will have the data.
docstr_tok: ["Args",":","_initial_array","(","None",",","cp.ndarray\/np.ndarray","(","including","variants",")",")",":","If","_initial_array","is","None",",","object","is","not","initialized",".","Otherwise",",","_initial_array","(","ndarray",")","would","be","set","to","_cupy_array","and\/or","_numpy_array","depending","upon","_supports_cupy",".","_supports_cupy","(","bool",")",":","If","_supports_cupy","is","True",",","_initial_array","is","set","as","_cupy_array","and","_numpy_array",".","Otherwise",",","_initial_array","is","set","as","only","_numpy_array",".","Attributes",":","_cupy_array","(","None","or","cp.ndarray",")",":","ndarray","fully","compatible","with","CuPy",".","This","will","be","always","set","to","a","ndarray","in","GPU",".","_numpy_array","(","None","or","np.ndarray","(","including","variants",")",")",":","ndarray","not","supported","by","CuPy",".","Such","as","np.ndarray","(","where","dtype","is","not","in","'","?","bhilqBHILQefdFD","'",")","and","it","'s","variants",".","This","will","be","always","set","to","a","ndarray","in","CPU",".","_supports_cupy","(","bool",")",":","If","_supports_cupy","is","True",",","data","of","array","will","contain","in","_cupy_array","and","_numpy_array",".","Else","only","_numpy_array","will","have","the","data","."]
code: def __init__(self, *args, **kwargs):
      """
      Args:
          _initial_array (None, cp.ndarray/np.ndarray(including variants)):
              If _initial_array is None, object is not initialized.
              Otherwise, _initial_array (ndarray) would be set to
              _cupy_array and/or _numpy_array depending upon _supports_cupy.
          _supports_cupy (bool): If _supports_cupy is True, _initial_array
              is set as _cupy_array and _numpy_array.
              Otherwise, _initial_array is set as only _numpy_array.
  
      Attributes:
          _cupy_array (None or cp.ndarray): ndarray fully compatible with
              CuPy. This will be always set to a ndarray in GPU.
          _numpy_array (None or np.ndarray(including variants)): ndarray not
              supported by CuPy. Such as np.ndarray (where dtype is not in
              '?bhilqBHILQefdFD') and it's variants. This will be always set
              to a ndarray in CPU.
          _supports_cupy (bool): If _supports_cupy is True, data of array
              will contain in _cupy_array and _numpy_array.
              Else only _numpy_array will have the data.
      """
  
      _supports_cupy = kwargs.pop("_supports_cupy", None)
      _initial_array = kwargs.pop("_initial_array", None)
      if _initial_array is None:
          return
  
      self._cupy_array = None
      self._numpy_array = None
      self.base = None
      self._supports_cupy = _supports_cupy
  
      assert isinstance(_initial_array, (cp.ndarray, np.ndarray))
      if _supports_cupy:
          if type(_initial_array) is cp.ndarray:
              # _initial_array is in GPU memory
              # called by _store_array_from_cupy
              self._cupy_array = _initial_array
              self._remember_numpy = False
          else:
              # _initial_array is in CPU memory
              # called by _store_array_from_numpy
              self._numpy_array = _initial_array
              self._remember_numpy = True
      else:
          self._numpy_array = _initial_array
  
imports: import types
  import numpy
  import cupy
  from cupyx.fallback_mode import notification
label_desc: Use image node_id 2 to create a new ndarray object from inherited base classes: object with example: obj = ndarray()