def put(
        self, indices: ndarray, values: ndarray, mode: str = "raise"
    ) -> None:
        """
        Replaces specified elements of the array with given values.

        Refer to :func:`cupynumeric.put` for full documentation.

        See Also
        --------
        cupynumeric.put : equivalent function

        Availability
        --------
        Multiple GPUs, Multiple CPUs

        """
        check_writeable(self)

        if values.size == 0 or indices.size == 0 or self.size == 0:
            return

        if mode not in ("raise", "wrap", "clip"):
            raise ValueError(
                "mode must be one of 'clip', 'raise', or 'wrap' "
                f"(got  {mode})"
            )

        if mode == "wrap":
            indices = indices % self.size
        elif mode == "clip":
            indices = indices.clip(0, self.size - 1)

        indices = _warn_and_convert(indices, np.dtype(np.int64))
        values = _warn_and_convert(values, self.dtype)

        if indices.ndim > 1:
            indices = indices.ravel()

        if self.shape == ():
            if mode == "raise":
                if indices.min() < -1 or indices.max() > 0:
                    raise IndexError("Indices out of bounds")
            if values.shape == ():
                v = values
            else:
                v = values[0]
            self._thunk.copy(v._thunk, deep=False)
            return

        # indices might have taken an eager path above
        indices = convert_to_cupynumeric_ndarray(indices)

        # call _wrap on the values if they need to be wrapped
        if values.ndim != indices.ndim or values.size != indices.size:
            values = values._wrap(indices.size)

        self._thunk.put(indices._thunk, values._thunk, mode == "raise")

        Replaces specified elements of the array with given values.

        Refer to :func:`cupynumeric.put` for full documentation.

        See Also
        --------
        cupynumeric.put : equivalent function

        Availability
        --------
        Multiple GPUs, Multiple CPUs

        
cupynumeric/_array/array.py