How to sample efficiently from time series data?

I know that I am late to this question and in addition I am asking only a remotely related question, but I am trying to do something similar like light_kira and the inner workings of tt.scan confuse me.

I have dummed down the above functionality to:

s0= 100.

C = np.array([3, 5, 8, 13, 21, 26, 10, 3], dtype=np.float64)
D = np.array([1, 2, 3, 7, 9, 11, 5, 1], dtype=np.float64)

def seir_one_step(st0):
st1 = st0 + tt.as_tensor_variable(1.0)
return st1

sk0 = [tt.dscalar() for x in [s0]]
st, updates = theano.scan(fn=seir_one_step, outputs_info=[sk0], n_steps=len(C))

f = theano.function(inputs=[sk0], outputs=(st), updates=updates)
f(1.0)
array([[2.],
[3.],
[4.],
[5.],
[6.],
[7.],
[8.],
[9.]])

But this outputs a 2d tensor.

The only way I seem to be able to generate a 1d tensor is by introducing a dummy second variable like this:

s0= 100.
st0 = [theano.shared(x) for x in [s0]]

C = np.array([3, 5, 8, 13, 21, 26, 10, 3], dtype=np.float64)
D = np.array([1, 2, 3, 7, 9, 11, 5, 1], dtype=np.float64)

def seir_one_step(st0, dt0):
st1 = st0 + tt.as_tensor_variable(1.0)
return st1, tt.as_tensor_variable(np.array(1.0, dtype=np.float64))

sk0,dk0 = [tt.dscalar() for x in [s0, 1.0]]
(st,_), updates = theano.scan(fn=seir_one_step, outputs_info=[sk0, dk0], n_steps=len(C))

f = theano.function(inputs=[sk0, dk0], outputs=(st,), updates=updates)
f(1.0, 1.0)
[array([2., 3., 4., 5., 6., 7., 8., 9.])]

How can I get a 1d tensor as output without having to resort to a dummy second variable?