Fix the bug that automatical tiling algorithm can't handle AsArray if the val is a np.ndarray.


Add a special case `add a new dimension` to reshape. Since this is the
most common use for reshape. This can help us get rid of `column fetch`
issue of reshape. But it doesn't fix the issue for all cases.
which operator will lead to child_id[0]
Assert? It must have some bugs. I think it is better not to add np array as a node, otherwise we will get much more nodes in our algorithm. Instead, I will try to fix this child_id[0] assert bug.

> ÔÚ Sep 12, 2014£¬8:44 PM£¬Chien-Chin Huang <notifications@github.com> Ð´µÀ£º
> 
> In spartan/expr/optimize.py:
> 
> >      if hash(expr) in _tiled_exprlist or isinstance(expr, DistArray) or \
> > -       isinstance(expr, (Val, AsArray)) and isinstance(expr.val, DistArray):
> > +       isinstance(expr, (Val, AsArray)):
> @MaggieQi I met some asserts if expr_node_ids == []. The assert will complain child_ids[0] since child_ids == expr_node_ids == []. That's why I remove and isinstance(expr.val, DistArray) and set tiling to True for np.ndarray. Or should I set tiling to False?
> 
> ¡ª
> Reply to this email directly or view it on GitHub.