# Skip preprocessing

**URL:** <https://discuss.ray.io/t/skip-preprocessing/3734>\
**Category:** RLlib\
**Created:** [October 5, 2021, 10:54pm UTC](https://discuss.ray.io/t/skip-preprocessing/3734 "2021-10-05T22:54:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheExGenesis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/theexgenesis/32/1502_2.png) [@TheExGenesis](https://discuss.ray.io/u/TheExGenesis)\
**Post date:** [October 5, 2021, 10:54pm UTC](https://discuss.ray.io/t/skip-preprocessing/3734/1 "2021-10-05T22:54:13Z")

</div>

My observation is a scipy sparse matrix. NoPreprocessing throws an error because it tries to .ravel() it. In the policy, I just use the raw observations anyway. Is there a way to skip the preprocessing altogether?

---

<div class="post-metadata">

**Author:** ![mannyv](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/mannyv/32/606_2.png) [@mannyv](https://discuss.ray.io/u/mannyv)\
**Post date:** [October 7, 2021, 12:13pm UTC](https://discuss.ray.io/t/skip-preprocessing/3734/2 "2021-10-07T12:13:17Z")

</div>

Hi @TheExGenesis,

I have used the following snippet to skip preprocessing before. It was a long time ago, pre ray 1.0 so it may no longer work. Looking at the NoPreprocessor code you are going to have to override the write method.

I have heard @sven1977 mention recently that getting rid of processors is in the plan but I am not sure of its status or timeline.

> <https://github.com/ray-project/ray/blob/8a72824c63dbae9d8d189ce9c553c2e8c4299494/rllib/models/preprocessors.py#L187-L207>

```python
    class AbsolutelyNoPreprocessor(NoPreprocessor):

        @override(NoPreprocessor)
        def transform(self, observation):
            return observation

       @override(Preprocessor)
       def write(self, observation: TensorType, array: np.ndarray,
                        offset: int) -> None:
           pass # Your implementation goes here

    ModelCatalog.register_custom_preprocessor("absolutely_no_preprocessor",
                                              AbsolutelyNoPreprocessorGAN)

```
