# Are there any plans for ragged tensors in pytorch?

**URL:** <https://discuss.pytorch.org/t/are-there-any-plans-for-ragged-tensors-in-pytorch/58758>\
**Category:** Uncategorized\
**Created:** [October 20, 2019, 10:58pm UTC](https://discuss.pytorch.org/t/are-there-any-plans-for-ragged-tensors-in-pytorch/58758 "2019-10-20T22:58:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Santosh-Gupta](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/santosh-gupta/32/30716_2.png) [@Santosh-Gupta](https://discuss.pytorch.org/u/Santosh-Gupta)\
**Post date:** [October 20, 2019, 10:58pm UTC](https://discuss.pytorch.org/t/are-there-any-plans-for-ragged-tensors-in-pytorch/58758/1 "2019-10-20T22:58:22Z")

</div>

Ragged tensors are useful in cases where labels have a varying length of inputs. For example, graph embeddings may vary in how many nodes they are connected to. Another example is Bert: the inputs may be a series of texts, which usually are not uniform in length, so inputs of a particular batch need to be padded to match the maximum sample length.

Both keras and original tensorflow have ragged tensors, I am wondering if there are any plans to introduce these to Pytorch.

---

<div class="post-metadata">

**Author:** ![albanD](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/alband/32/215_2.png) [@albanD](https://discuss.pytorch.org/u/albanD)\
**Post date:** [October 21, 2019, 3:44pm UTC](https://discuss.pytorch.org/t/are-there-any-plans-for-ragged-tensors-in-pytorch/58758/2 "2019-10-21T15:44:16Z")

</div>

Hi,

We are currently implementing NestedTensors that are similar. You can find the RFC and progress in that issue: [https://github.com/pytorch/pytorch/issues/25032](https://github.com/pytorch/pytorch/issues/25032)
