def __setitem__(self, key: Any, value: ndarray) -> None:
        """__setitem__(key, value, /)

        Set ``self[key]=value``.

        """
        check_writeable(self)

        if value.dtype != self.dtype:
            temp = ndarray(value.shape, dtype=self.dtype, inputs=(value,))
            temp._thunk.convert(value._thunk)
            value = temp

        if len(value.shape) > len(self.shape):
            N = len(value.shape) - len(self.shape)
            first = value.shape[:N]
            if builtin_prod(first) == 1:
                value = value.squeeze(tuple(range(N)))
            else:
                raise ValueError(
                    "could not broadcast input array from shape "
                    f"{value.shape} into shape {self.shape}"
                )

        key = self._convert_key(key)
        self._thunk.set_item(key, value._thunk)
__setitem__(key, value, /)

        Set ``self[key]=value``.

        
cupynumeric/_array/array.py