def stack(xs, axis=0):
 xs = [expand_dims.expand_dims(x, axis=axis) for x in xs]
 return concat.concat(xs, axis=axis)

def stack ( xs , axis = 0 ) : xs = [ expand_dims . expand_dims ( x , axis = axis ) for x in xs ] return concat . concat ( xs , axis = axis )
concatenate variables along a new axis .