# Reshape/Flatten layer support?

**URL:** <https://community.konduit.ai/t/reshape-flatten-layer-support/3081>\
**Category:** DL4J\
**Created:** [February 27, 2024, 7:59am UTC](https://community.konduit.ai/t/reshape-flatten-layer-support/3081 "2024-02-27T07:59:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmingkr](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/pmingkr/32/1264_2.png) [@pmingkr](https://community.konduit.ai/u/pmingkr)\
**Post date:** [February 27, 2024, 7:59am UTC](https://community.konduit.ai/t/reshape-flatten-layer-support/3081/1 "2024-02-27T07:59:50Z")

</div>

I’m using a 1d convolution layer as the output layer with multi channels.  
but the output layer treats the channels as the multiple mini batches.

so it multiplies the mini batch size with the channel size.  
and it makes the error on training.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/konduit/original/2X/5/5086180d204e2225a20b5bf5e422f731babec05a.png)  
the layer get the batch size from the graph but it indicates the batch size of the output layer.  
`FeedForwardToRnnPreProcessor.preProcess()`  
divides the shape with the over-sized mini batch size. and it becomes zero.

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [February 28, 2024, 6:42am UTC](https://community.konduit.ai/t/reshape-flatten-layer-support/3081/2 "2024-02-28T06:42:36Z")

</div>

@pmingkr you can use the reshape preprocessor here:

> <https://github.com/deeplearning4j/deeplearning4j/blob/master/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/preprocessors/ReshapePreprocessor.java>

for the multilayenr network api.

For anything more complicated, consider using the computation graph api which has a reshape vertex.
