# How to add a dummy dimension?

**URL:** <https://discourse.pymc.io/t/how-to-add-a-dummy-dimension/791>\
**Category:** Questions\
**Created:** [January 26, 2018, 2:47pm UTC](https://discourse.pymc.io/t/how-to-add-a-dummy-dimension/791 "2018-01-26T14:47:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![madanh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/madanh/32/500_2.png) [@madanh](https://discourse.pymc.io/u/madanh)\
**Post date:** [January 26, 2018, 2:47pm UTC](https://discourse.pymc.io/t/how-to-add-a-dummy-dimension/791/1 "2018-01-26T14:47:07Z")

</div>

To use Ordered() I have to have my vector of dimension N, but then I do some manipulation with the result and the rest of the function is written to accept (N,1) shaped stuff (subclasses of theano tensors, I suppose). What is the proper way to add a dummy dimension?

---

<div class="post-metadata">

**Author:** ![junpenglao](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/junpenglao/32/8_2.png) [@junpenglao](https://discourse.pymc.io/u/junpenglao)\
**Post date:** [January 26, 2018, 2:48pm UTC](https://discourse.pymc.io/t/how-to-add-a-dummy-dimension/791/2 "2018-01-26T14:48:32Z")

</div>

There is a discussion here

> [@Order statistics in PyMC3](https://discourse.pymc.io/t/order-statistics-in-pymc3/617/3):
>
> OK, I cooked up something that kind of work: import numpy as np import pymc3 as pm import theano.tensor as tt # data K = 5 # number of items being ranked J = 20 # number of raters yreal = np.argsort(np.random.randn(K, 1), axis=0) print(yreal) y = np.argsort(yreal + np.random.randn(K, J), axis=0) print(y) class Ordered2D(pm.distributions.transforms.ElemwiseTransform): name = "ordered" def forward(self, x): out = tt.zeros(x.shape) out = tt.inc\_subtensor(out[0,:], x[0,:]…
