def perform(self, node, inputs, output_storage):
        x, new_length, nonconstants = inputs
        nonconstant_set = set(nonconstants)
        constant = sorted(set(xrange(new_length)) - nonconstant_set)
        assert x.shape[self.axis] == len(nonconstant_set), (
            "x.shape[%d] != len(set(nonconstants))" % self.axis
        )
        assert new_length >= x.shape[self.axis], (
            "number of items along axis in new array is less than old array"
        )
        new_shape = (x.shape[:self.axis] +
                     (int(new_length),) +
                     x.shape[(self.axis + 1):])
        z = output_storage[0][0] = np.empty(new_shape, dtype=x.dtype)
        z[index_along_axis(nonconstants, self.ndim, self.axis)] = x
        z[index_along_axis(constant, self.ndim, self.axis)] = self.fill
.. todo::
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/utils/insert_along_axis.py/InsertAlongAxis.perform