Compute minimum peak

1. apply pseudo code
2. create compute_map and node_mem in new method
idx isn't used after the computation of saved_by_inplace. So you can reuse
it. Just init it again to 0.

In fact, you can merge those 2 loops together. If you don't see how, this
can wait for after we merge a working version.


On Tue, Aug 19, 2014 at 12:25 AM, Roy Xue <notifications@github.com> wrote:

> In theano/compile/profiling.py:
>
> > -                    elif not isinstance(v, str):
> > -                        node_memory_size += v
> > -                        running_memory_size += v
> > -                        if running_memory_size > running_max_memory_size:
> > -                            running_max_memory_size = running_memory_size
> > -                        old_storage = thunk_old_storage[order.index(node)]
> > -                        for old_s in old_storage:
> > -                            old_v = var_mem[node.inputs[old_s]]
> > -                            if not isinstance(old_v, str):
> > -                                running_memory_size -= old_v
> > -
> > -            return [node_memory_size, running_memory_size, running_max_memory_size, node_memory_saved_by_inplace, node_memory_saved_by_view]
> > +                    idx = 1
> > +
> > +                for out in node.outputs:
> > +                        if (dmap or vmap):
>
> @nouiz <https://github.com/nouiz>
> I think at this place, use idx in dmap or vmap is used to track the memory
> is saved_by_inplace or saved_by_view. so maybe we dont need to use that
> check again?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Theano/Theano/pull/1934/files#r16396562>.
>