# No more stack function?

**URL:** <https://community.konduit.ai/t/no-more-stack-function/3532>\
**Category:** ND4J\
**Created:** [July 13, 2026, 3:14am UTC](https://community.konduit.ai/t/no-more-stack-function/3532 "2026-07-13T03:14:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lana](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@Lana](https://community.konduit.ai/u/Lana)\
**Post date:** [July 13, 2026, 3:14am UTC](https://community.konduit.ai/t/no-more-stack-function/3532/1 "2026-07-13T03:14:31Z")

</div>

The manual gives examples of Nd4j.stack()

> **[Stack and Unstack - Matrix Manipulation | Deeplearning4j](https://deeplearning4j.konduit.ai/nd4j/matrix-manipulation#stack-and-unstack)**
>
> Shape manipulation covers all operations that change how an INDArray is structured — its rank, its dimension sizes, the order of its axes, or how multiple arrays are combined into one. These operations are frequent in neural network code (batching,...

as

INDArray batch = Nd4j.stack(0, sample1, sample2, sample3);

But java does not find any stack function, only vstack and hstack. What am I missing?

---

<div class="post-metadata">

**Author:** ![Lana](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@Lana](https://community.konduit.ai/u/Lana)\
**Post date:** [July 23, 2026, 5:22am UTC](https://community.konduit.ai/t/no-more-stack-function/3532/2 "2026-07-23T05:22:16Z")

</div>

Does no one else use stack, or am I missing a very obvious workaround…?

---

<div class="post-metadata">

**Author:** ![Lana](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@Lana](https://community.konduit.ai/u/Lana)\
**Post date:** [July 23, 2026, 6:37am UTC](https://community.konduit.ai/t/no-more-stack-function/3532/3 "2026-07-23T06:37:39Z")

</div>

I ended up reimplementing stack() by hand, which I am sure will introduce issues of slow computing later down the line… but it’s not the first time I find I have to write by hand something that I am sure other people are using correctly and I just can’t find my way around the library - I also have super basic issues with the “repeat()” function and no hits in the forum with the search function… I can’t help feeling I am trying to use this library very wrong.

Maybe it’s because I installed it from maven and the version over there seems quite outdated?

---

<div class="post-metadata">

**Author:** ![Booker](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/booker/32/987_2.png) [@Booker](https://community.konduit.ai/u/Booker)\
**Post date:** [July 30, 2026, 1:24pm UTC](https://community.konduit.ai/t/no-more-stack-function/3532/4 "2026-07-30T13:24:40Z")

</div>

vstack or hstack not work for you?
