def _read_cuda()

in mujoco_py/mjbatchrenderer.pyx [0:0]


    def _read_cuda(self):
        if not self._cuda_buffers_are_mapped:
            raise CudaBufferNotMappedError(
                "CUDA buffers must be mapped before reading")

        rgb_arr = drv.from_device(
            self._cuda_rgb_ptr,
            shape=(self._batch_size, self._height, self._width, 3),
            dtype=np.uint8)

        if self._depth:
            depth_arr = drv.from_device(
                self._cuda_depth_ptr,
                shape=(self._batch_size, self._height, self._width),
                dtype=np.uint16)
        else:
            depth_arr = None

        return rgb_arr, depth_arr